亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將多個短信發送到一個號碼

如何將多個短信發送到一個號碼

尚方寶劍之說 2020-02-03 13:00:34
主要活動代碼public class MainActivity extends Activity implements OnItemClickListener, OnClickListener{Button send;ListView listViewSMS;Cursor cursor;SMSListAdapter smsListAdapter;Context context;ArrayAdapter<SMSListModel> adapter;List<SMSListModel> list = new ArrayList<SMSListModel>();TextView textViewSMSSender, textViewSMSBody;int i;int count = 0;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.activity_main);    context=this;    listViewSMS=(ListView)findViewById(R.id.lvSMS);    send = (Button)findViewById(R.id.send);    send = (Button)findViewById(R.id.send);    textViewSMSSender=(TextView)findViewById(R.id.tvSMSSend);    textViewSMSBody=(TextView)findViewById(R.id.tvSMSBody);    cursor = getContentResolver().query(Uri.parse("content://sms/inbox"), null, null, null, null);    smsListAdapter = new SMSListAdapter(this,getModel());    listViewSMS.setAdapter(smsListAdapter);    listViewSMS.setOnItemClickListener(this);}@Overridepublic void onItemClick(AdapterView<?> arg0, View v, int arg2, long arg3) {    TextView label = (TextView) v.getTag(R.id.tvSMSSend);    CheckBox checkbox = (CheckBox) v.getTag(R.id.cbSelect);    Toast.makeText(v.getContext(), label.getText().toString()+" "+isCheckedOrNot(checkbox), Toast.LENGTH_LONG).show();      }private String isCheckedOrNot(CheckBox checkbox) {    if(checkbox.isChecked())        return "is checked";    else        return "is not checked";}private List<SMSListModel> getModel() {    if(cursor.getCount()>0){        for(i=0;i<cursor.getCount();i++){            if(cursor.moveToPosition(i)){                list.add(new SMSListModel(cursor.getString(cursor.getColumnIndex("address")),cursor.getString(cursor.getColumnIndex("body"))));            }        }    }    return list;}我想使用復選框選擇發送多個短信。僅將選定短信的內容(即它們的主體)作為新的消息主體發送到已預定義的#121,但是上述代碼在執行選擇后將完整的收件箱消息(無論是否選中)發送到121。
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 830 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號