簡體   English   中英

在android中發送計划短信

[英]send schedule sms in android

HII,

我已經為發送短信及其工作設置了警報但是當有多個警報設置發送短信方法時會產生問題,因為它開始循環並給出錯誤我正在使用SMS管理器發送消息

PLZ給我解決方案,因為我面臨很多問題。

Thanx提前

嘗試以下代碼

AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
Bundle bnd1=new Bundle();
    bnd1.putString("Contacts", Selected_Conta.toString());
    bnd1.putString("Message", Messa);
    selectedDate.set(syear, smonth, sday, mHour, mMinute,0);
    Intent in=new Intent(ScheduleSMS.this,SMSReceiver.class);
    in.putExtras(bnd1);
    in.setAction(ACTION_SCHEDULE_SMS);
    PendingIntent sender = PendingIntent.getBroadcast(this,Request code, in, 0);
    am.set(AlarmManager.RTC_WAKEUP,selectedDate.getTimeInMillis(),sender)

現在在接收器中,您將在計划時間獲得此捆綁,因此只需從那里發送消息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM