Search code examples
androidandroid-widgetappwidgetprovider

Appwidget can't update because of Failed Binder transaction


When I first add the widget on the screen, it works with no error, and then when I clicked the button on the widget to go into the activity and close it. The widget stops updating and shows this error

12-19 19:14:52.370: E/JavaBinder(14805): !!! FAILED BINDER TRANSACTION !!!

here is my code:

Widget4x2.remoteViews.setProgressBar(R.id.widget_progressbar, 100, (int)(NowPlayingService.progress * 100), false);
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(Widget4x2.context);
appWidgetManager.updateAppWidget(new ComponentName(Widget4x2.context,Widget4x2.class), Widget4x2.remoteViews);

Are there any problems with the code?


Solution

  • I guess Widget4x2.remoteViews is a static variable. It is likely the static variable hasn't been assigned, or it is not properly initiated.