在RemoteViews中调用updateAppWidget时,TransactionTooLargeException(仅适用于android 7.0和6.0)

时间:2019-06-07 13:21:09

标签: android android-7.0-nougat jobintentservice transactiontoolargeexception

我在控制台中有很多TransactionTooLargeException崩溃报告(有趣的是-几乎完全来自旧版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)

0 个答案:

没有答案