Android sometimes I get android.app.RemoteServiceException: bad notification sent from package. What for?

I have a serious problem with my notification.

Sometimes, when my application publishes the same user notification, I get this error:

android.app.RemoteServiceException: Bad notification posted from package com.packagename: Couldn't expand RemoteViews for: ClassName(package=com.packagename id=0 tag=null notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x22)) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1093) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3906) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:840) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:598) at dalvik.system.NativeStart.main(Native Method) 

What should I do?

The notification only contains LinearLayout, TextViews and ImageViews, and it works great most of the time.

Is there a way to circle this error with try / catch so that android does not stop my application in this way?

Many thanks...

+8
android exception notifications
source share
1 answer

1) http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/android/app/ActivityThread.java#ActivityThread

This shows that this error can occur only in one case:

 case SCHEDULE_CRASH: throw new RemoteServiceException((String)msg.obj); 

2) http://openstorage.gunadarma.ac.id/android/sdk/sdk_310712/sources/android-15/android/app/ApplicationThreadNative.java

 case SCHEDULE_CRASH_TRANSACTION: { data.enforceInterface(IApplicationThread.descriptor); String msg = data.readString(); scheduleCrash(msg); return true; } 

So this error comes from ApplicationThreadNative

You can try to track ahead, and you may find the cause of this error.

+2
source share

All Articles