我想通过我的应用程序发送短信。我正在使用短信管理器的sendTextMessage。但是当我发送群发短信时,它没有发送短信。
发布于 2013-07-13 18:02:05
我可以使用以下logic.It发送GroupMessage使用应用全局state.when发送短信,应用暂停并将控制权转移到短信Service.On服务返回,它恢复活动并继续发送第二个number.This进程,直到短信发送完所有号码。
我希望这段代码能对你有所帮助。
@Override
protected Void doInBackground(Void... params) {
// TODO Auto-generated method stub
String message;
if (!TextUtils.isEmpty(etSendmessage.getText())) {
message = etSendmessage.getText().toString();
// Toast.makeText(GroupMessaging.this,"Message field is Empty",
// Toast.LENGTH_SHORT).show();
publishProgress(0);
for (int i = 0; i < contactCount; i++) {
MyApplication.activityPaused();
mService.send(groupPhoneNumber[i], message, dataFinal);
Log.i("name", groupPhoneName[i]);
publishProgress(i + 1);
do {
} while (!(MyApplication.isActivityVisible()));
Log.i("count", "count" + i);
}
}
return null;
}https://stackoverflow.com/questions/16934533
复制相似问题