onDeleted, onDisabled are not being called at all when removing an android widget

主宰稳场 提交于 2019-12-23 21:08:43

问题


Seems this has been a pain for some time now (did quite a bit of research in SO and on the net)

In a nutshell the android documentation states:

  • onReceive will be called before every other lifecycle method calls
  • onDeleted will be called when a widget is removed
  • onDisabled will be called when the last widget is deleted

Well, when deleting a widget neither onReceive nor subsequently onDeleted is being called. Similarly, when the last widget is removed the code does not reach to onDisabled either.

1. This has been an issue since android version 1.5 and continues to be up to now.

Android developers at Google, what was the reason of not fixing this after over 10 major releases?

To everybody else...

Is there any workaround for this regardless how ugly it might be?

Excuse my frustrated tone.

来源:https://stackoverflow.com/questions/12812234/ondeleted-ondisabled-are-not-being-called-at-all-when-removing-an-android-widge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!