我的小部件有些问题.这是描述:
语境:
我有一个家庭小部件.
当我添加它时,它会弹出一个配置Activity来设置窗口小部件的一些参数.
如果我调用setResult(RESULT_OK,resultValue); 在完成配置Activity之前,窗口小部件将添加到Home.
If I delete the widget by dragging it to the trash bin, public void onDeleted(Context context, int[] appWidgetIds) from my AppWidgetProvider class gets called. So far so good.
Problem: If the configuration Activity exits with result code RESULT_CANCELED (setResult(RESULT_CANCELED);), public void onDeleted(Context context, int[] appWidgetIds) from my AppWidgetProvider class is not called and the widget remains in the active widgets list. When I restart the phone, onUpdate(Context context, AppWidgetManager appWidgetManager, int[] …