我在控制台中有很多 TransactionTooLargeException 崩溃报告(有趣的是 - 几乎完全来自较旧的 android 版本 7.0 和 6.0 - 几乎没有来自较新的 android)。
它总是发生在我的 JobIntentService 的这行代码上:
@Override
protected void onHandleWork(Intent intent) {
...
appWidgetManager.updateAppWidget(id, updateViews);//this line
}
为什么会发生,如何避免?有人有经验吗?崩溃日志在这里:
Caused by: android.os.TransactionTooLargeException:
at android.os.BinderProxy.transactNative (BinderProxy.java)
at android.os.BinderProxy.transact (BinderProxy.java:503)
at com.android.internal.appwidget.IAppWidgetService$Stub$Proxy.updateAppWidgetIds (IAppWidgetService.java:636)
at android.appwidget.AppWidgetManager.updateAppWidget (AppWidgetManager.java:474)
at android.appwidget.AppWidgetManager.updateAppWidget (AppWidgetManager.java:550)
at my.package.myapp.services.MyJobIntentService.onHandleWork (MyJobIntentService.java:99)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:392)
at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:383)
at android.os.AsyncTask$2.call (AsyncTask.java:295)
at java.util.concurrent.FutureTask.run (FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:588)
at java.lang.Thread.run (Thread.java:818)