D
D
dias dias2021-04-25 04:20:13
SMS
dias dias, 2021-04-25 04:20:13

Sending SMS using Android Studio ListView?

How can I send SMS to creditors to the phone numbers listed in Android Studio in listview_1? Here is my unfinished project, please anyone know help

package com.example.KREDIT;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.telephony.SmsManager;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;

import static com.example.KREDIT.R.id.listview_1;

public class S_Nadirov extends AppCompatActivity {
private ListView listView;
private void sendSms(){
SmsManager sms = SmsManager.getDefault();
ArrayList parts = sms.divideMessage("MESSAGE");
sms.sendMultipartTextMessage(String.valueOf(listview_1), null, parts, null,
null);}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_s__nadirov);
listView = findViewById(listview_1);
String[] values ​​= new String[]{
" TOGAYEV JAXONGIR 6189057.43 sum 998931508870 " ,
" EGAMQULOV JALOLIDDIN 16075349.89 sum 998973927802 " ,
" Kubayeva Mavjuda 77.96 sum 998932320974 " ,

};

ArrayAdapter adapter = new ArrayAdapter<>( this,
android.R.layout.simple_list_item_1,
android.R.id.text1, values);
listView.setAdapter(adapter);
}
}

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
package="com.example.KREDIT">

android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label ="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.KREDIT">
android:theme="@style/Theme.AppCompat.DayNight .NoActionBar"/>










Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2021-04-25
@dimonchik2013

it's time to complete the project
https://freelance.habr.com/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question