0

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?

Community
  • 1
  • 1
doga
  • 471
  • 2
  • 9
  • 20
  • What i am collecting is that you will not be able to get remove intent in your own application. Please recheck with googling. – Roll no1 Dec 30 '14 at 07:09
  • http://stackoverflow.com/a/18816716/233048 – mach Dec 30 '14 at 07:36
  • Are you not receiving the broadcastmessage in the app that is about to get uninstalled? Think about it: you want to receive a broadcast message of your app being uninstalled, while your app is being uninstalled. It doesn't make sense in my opinion. Develop a debug app to check if the broadcastmessage has been send – tim687 Dec 30 '14 at 10:20
  • If you actually read my answer (which you linked to in your post), it specifically says **"This means that the Intent will only by broadcast for non-device-admin applications that are already stopped."** You don't get the broadcast Intent because your application has not been force stopped and therefore the broadcast Intent is not sent! If your app was force-stopped, then the broadcast Intent would be sent, but you wouldn't see it because your app is in stopped state! – David Wasser Dec 30 '14 at 15:42
  • Hi @DavidWasser Thanx for response... Now i understood ur answer completely... Now lets say i am trying to detect uninstallation of one app using other app, user will usually go to settings->Apps->uninstall... irrespective of checking whether app is already stopped or not. In this way app is uninstalled and another app (UninstallationDetectionApp) won't get intent of uninstallation. Is there any further approach to solve this issue??? – doga Jan 02 '15 at 08:06
  • Not that I know of. That's what device admins are for. – David Wasser Jan 05 '15 at 10:40
  • Yeah i have implemented using Device Admin... – doga Jan 05 '15 at 11:51

0 Answers0