为什么应用程序小部件在重新启动启动器后停止工作?

Why App widget stops working after restarting laucher?

一式两份选择的答案是错误

widget应用重启会产生NPE

————————————

它是一个 TorchWidget 应用程序,包含 2 类:

class1 AppWidgetProvider

class2 IntentService

Github.

上的完整代码

重新启动后,恢复的视图将是IntentService中实例化的视图,没有OnClickPendingIntent

要解决这个问题,我应该通过 broadcasts.

仅在提供程序 的更新功能中更改图标

还是个问题,why the OnClickPendingIntent will work until launcher restart, after view is replaced