只能发送一定数量的短信

时间:2012-06-07 02:25:16

标签: java android

我有一个程序只需按一下按钮即可发送大量文本。它在我的Evo上运行良好,但我刚刚获得了Evo LTE,现在只发送给28个人中的前13个人。

它的工作方式是从字符串数组中读取电话号码列表,然后根据我按下的按钮发送预定义的消息。

我拉了一只原木猫,这就是我得到的:

06-06 11:25:34.850: W/MessageQueue(28308): null sending message to a Handler on a dead thread
06-06 11:25:34.850: W/MessageQueue(28308): java.lang.RuntimeException: null sending message to a Handler on a dead thread
06-06 11:25:34.850: W/MessageQueue(28308):  at android.os.MessageQueue.enqueueMessage(MessageQueue.java:200)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.os.Looper.quit(Looper.java:245)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.os.HandlerThread.quit(HandlerThread.java:96)
06-06 11:25:34.850: W/MessageQueue(28308):  at com.htc.usage.service.UsageStatsService.onDestroy(UsageStatsService.java:197)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.app.ActivityThread.handleStopService(ActivityThread.java:2762)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.app.ActivityThread.access$2000(ActivityThread.java:139)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1338)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.os.Looper.loop(Looper.java:154)
06-06 11:25:34.850: W/MessageQueue(28308):  at android.app.ActivityThread.main(ActivityThread.java:4977)
06-06 11:25:34.850: W/MessageQueue(28308):  at java.lang.reflect.Method.invokeNative(Native Method)
06-06 11:25:34.850: W/MessageQueue(28308):  at java.lang.reflect.Method.invoke(Method.java:511)
06-06 11:25:34.850: W/MessageQueue(28308):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-06 11:25:34.850: W/MessageQueue(28308):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-06 11:25:34.850: W/MessageQueue(28308):  at dalvik.system.NativeStart.main(Native Method)
06-06 11:25:35.320: D/PhoneStatusBarPolicy(611): @@ iconIndex=1
06-06 11:25:35.320: D/PhoneStatusBarPolicy(611): isCdma():true hasService:true mSimState=UNKNOWN gprsState=0 mDataState=2 dataActivity=4 mPhone.htcModemLinkOn:false hspa==true
06-06 11:25:35.330: D/PhoneStatusBarPolicy(611): hasService()=true ,mDataState=2 ,mPhone.htcModemLinkOn()=false ,mDataActivity=4
06-06 11:25:35.340: D/PhoneStatusBarPolicy(611): slotType[0]=SIM
06-06 11:25:35.451: V/UsageStatsService(28308): CMD_ID_UPDATE_MESSAGE_USAGE
06-06 11:25:35.471: V/UsageStatsService(28308): MSG_ON_MESSAGE_UPDATE
06-06 11:25:35.501: V/UsageStatsService(28308): MSG_STOP_SERVICE
06-06 11:25:35.501: V/UsageStatsService(28308): onDestroy

从未善于阅读原木猫。对于每个剩下的人,这在第十三个人之后重复。有人能告诉我发生了什么吗?

以下是我的编码:http://pastebin.com/xe4U4GYZ

1 个答案:

答案 0 :(得分:2)

根据log cat,您的线程已经终止。一个修复可能是使您的应用程序多线程。但是,请查看您的线程的终止条件,看看是否有什么东西导致早死。

相关问题