Hey I was working on an android application that sends and receives text messages, and I was trying to find a way to delete the text messages that pertained to the application. I came across the abortBroadcast() method in a few posts, and decided to give it a try. I placed several abortBroadcast() calls in my various trees of if statements (different texts cause different actions).
Well after i sent myself a text from the application, i didn’t receive it. So I figured I may have over-killed it with the abortBroadcast commands. But even after I removed all of them from my code, and even uninstalled the application from my phone, and restarted the phone, I still cannot receive any text messages! Sending works fine, but I can’t get any texts anymore. The error I get upon receipt of a text is listed in entirety below.
05-13 16:08:04.015: E/SMSDispatcher(731): Exception dispatching message
05-13 16:08:04.015: E/SMSDispatcher(731): java.lang.ArrayIndexOutOfBoundsException
05-13 16:08:04.015: E/SMSDispatcher(731): at com.android.internal.telephony.SMSDispatcher.processMessagePart(SMSDispatcher.java:970)
05-13 16:08:04.015: E/SMSDispatcher(731): at com.android.internal.telephony.gsm.GsmSMSDispatcher.dispatchMessage(GsmSMSDispatcher.java:307)
05-13 16:08:04.015: E/SMSDispatcher(731): at com.android.internal.telephony.SMSDispatcher.handleMessage(SMSDispatcher.java:523)
05-13 16:08:04.015: E/SMSDispatcher(731): at android.os.Handler.dispatchMessage(Handler.java:99)
05-13 16:08:04.015: E/SMSDispatcher(731): at android.os.Looper.loop(Looper.java:130)
05-13 16:08:04.015: E/SMSDispatcher(731): at android.app.ActivityThread.main(ActivityThread.java:3859)
05-13 16:08:04.015: E/SMSDispatcher(731): at java.lang.reflect.Method.invokeNative(Native Method)
05-13 16:08:04.015: E/SMSDispatcher(731): at java.lang.reflect.Method.invoke(Method.java:507)
05-13 16:08:04.015: E/SMSDispatcher(731): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-13 16:08:04.015: E/SMSDispatcher(731): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-13 16:08:04.015: E/SMSDispatcher(731): at dalvik.system.NativeStart.main(Native Method)
How can I fix this error in my phone!? For the record, none of these errors listed above are from my code, all of the code is Android OS stuff. If no one knows how, do you know who I can contact to get help about this? I don’t really want to reset my phone…
Simply try:
This clears the flag you set with the abort.
Take a look here for further Information:
http://developer.android.com/reference/android/content/BroadcastReceiver.html