Need to perform some activity during the unistalla

2019-03-06 09:42发布

问题:

I am working on an app in which i need to log, if user uninstalls the app. So i am following this approach How can an app detect that it's going to be uninstalled?

But i am facing the same problem as in this post Can't get receiver when the app uninstall. As my phone is Android 4.4... Can anybody post the exact solution (code) to solve this problem???

Edit: During uninstallation QUERY_PACKAGE_RESTART intent should be broadcasted but i am not recieving it. I declared it in manifest as well i created a broadcastreceiver which is listening for this intent... I did it exactly same way as Can't get receiver when the app uninstall. I am not receiving the intent. What to do?