Catch a runtime exception ('System server dead') the system would sometimes throw in the widget

pull/14/head
Sam Bosley 12 years ago
parent 53d6c2387d
commit c18cc937b0

@ -140,9 +140,15 @@ public class TasksWidget extends AppWidgetProvider {
if(intent != null) if(intent != null)
extrasId = intent.getIntExtra(EXTRA_WIDGET_ID, extrasId); extrasId = intent.getIntExtra(EXTRA_WIDGET_ID, extrasId);
if(extrasId == AppWidgetManager.INVALID_APPWIDGET_ID) { if(extrasId == AppWidgetManager.INVALID_APPWIDGET_ID) {
for(int id : manager.getAppWidgetIds(thisWidget)) { int[] ids;
RemoteViews updateViews = buildUpdate(this, id); try {
manager.updateAppWidget(id, updateViews); ids = manager.getAppWidgetIds(thisWidget);
for(int id : ids) {
RemoteViews updateViews = buildUpdate(this, id);
manager.updateAppWidget(id, updateViews);
}
} catch (RuntimeException e) {
// "System server dead" was sometimes thrown here by the OS. Abort if that happens
} }
} else { } else {
int id = extrasId; int id = extrasId;

Loading…
Cancel
Save