【发布时间】:2017-09-19 11:36:25
【问题描述】:
只要我想显示一个小部件并开始收听,我就会收到以下异常:
// the relevant stack trace, the rest is comming from my code
// before the code line I posted below
java.lang.RuntimeException: system server dead?
at android.appwidget.AppWidgetHost.startListening(AppWidgetHost.java:189)
at com.my.app.utils.WidgetUtil.a(SourceFile:231)
...
android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at com.android.internal.appwidget.IAppWidgetService$Stub$Proxy.startListening(IAppWidgetService.java:481)
at android.appwidget.AppWidgetHost.startListening(AppWidgetHost.java:185)
at com.my.app.utils.WidgetUtil.a(SourceFile:231)
...
我的代码中的源代码如下:
mAppWidgetManager = AppWidgetManager.getInstance(context);
mAppWidgetHost = new AppWidgetHost(context, R.string.app_name);
mAppWidgetHost.startListening(); // <= this line leads to the crash
观察
- 我的应用在很多手机上都能正常运行(实际上只有一部除外)
- 上述崩溃仅发生在一台用户设备上(SM-N910C(Samsung Note 4),Android 6.0.1)
- 用户说,这些小部件在他的启动器中运行良好
有人知道是什么原因造成的吗?这是我可以在我的应用程序中解决的问题吗?用户说小部件在他的启动器中运行良好...
【问题讨论】: