1

I have this code for checking app uninstall:

    public void onReceive(Context context, Intent intent){
    final String action = intent.getAction();
        if("android.intent.action.PACKAGE_REMOVED".equals(action)){
        // some action
    }

Now I want get the start intent from the uninstalled app. Is it possible?

Name is Nilay
  • 2,743
  • 4
  • 35
  • 77
DrFred
  • 461
  • 3
  • 6

2 Answers2

1

Refer to following URLs:

The Post by Janusz is very helpful here..

Sadly android at the moment does not give you a possibility to perform code at the moment your app is uninstalled.

All the settings that are set via the SharedPreferences are deleted together with everything in the Aplication Data an Cache folder.

The only thing that will persist is the data that is written to the SD-Card and any changes to phone settings that are made. I don't know what happens to data that is synchronized to the contacts through your app.

Community
  • 1
  • 1
Name is Nilay
  • 2,743
  • 4
  • 35
  • 77
  • I don't explane very well my questions. I don't wanto to know when my app is unistalled. I want to know when any app is unistalled, by the indent pagkage_removed, and know what is the indent of unistalled app. – DrFred Sep 27 '12 at 15:52
1

I guess the only way to discover this is to test this. You can use the following code to find the launch intent of an application:

final Intent launchIntent = pm.getLaunchIntentForPackage(packageName);

where pm - is PackageManager.

To my point of view this is impossible and you'll receive launchIntent equal to null. But you should check this on your own.

Yury
  • 20,618
  • 7
  • 58
  • 86
  • Thanks for reply and it's could almost be a solution, but I have a database with intent of some app (I can save on database also the package) and when one app is unistalled I would delete all record for this app. The problem is to know which app is unistalled. So, in getLaunchIntentForPackage(packageName), packageName = ??? – DrFred Sep 29 '12 at 14:30