4

I have an android app, I want to run some process or show some message to user if he is uninstalling app, how to do that in android...

om252345
  • 2,395
  • 4
  • 29
  • 31
  • The application `NQ Mobile Security` is calling an Activity at uninstall look at the http://i.imgur.com/Fos9N.png, http://i.imgur.com/fIZbK.png, http://i.imgur.com/cG9Hr.png and the question http://stackoverflow.com/questions/10219328/how-to-show-an-activity-before-my-app-is-uninstalled-android – Gaurav Agarwal Jun 16 '12 at 09:46

2 Answers2

6

You could have a second app set up to receive a PACKAGE_REMOVED broadcast when the original app is removed. I don't think you can affect the first app being removed, but you at least you can react to it (to clean up files, etc.). That would only work, of course, if the second app was not removed first.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
  • The application `NQ Mobile Security` is calling an Activity at uninstall look at the http://i.imgur.com/Fos9N.png, http://i.imgur.com/fIZbK.png, http://i.imgur.com/cG9Hr.png and the question http://stackoverflow.com/questions/10219328/how-to-show-an-activity-before-my-app-is-uninstalled-android – Gaurav Agarwal Jun 16 '12 at 09:46
  • @darkcrow - Perhaps it is starting a background process at system start-up that watches the package status. I'm shocked that an app is able to intercept a package uninstall request like that. It would be interesting to see a dump of running processes on a phone with NQ Mobile Security installed. – Ted Hopp Jun 17 '12 at 01:59
  • I have started a new question here. The discussion here may interest you http://stackoverflow.com/questions/11062780/how-to-start-an-activity-or-service-before-an-app-application-is-uninstalled-by – Gaurav Agarwal Jun 17 '12 at 07:40
1

Not possible. If your user wants to uninstall your app, why do you think it would be OK to have anything pop up before they can do that?

Falmarri
  • 47,727
  • 41
  • 151
  • 191
  • If I have changed stock app database and I want to rollback changes before uninstall then a service before uninstall is needed... – om252345 Jan 31 '11 at 04:17