Reputation: 1932
Folks,
I have one application to develop in which I need notification when the user uninstalls the application. I have ACTION_PACKGE_REMOVED action in Broadcast Receiver but it does nothing.
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
try
{
if(intent.getAction().equals(Intent.ACTION_PACKAGE_CHANGED))
{
System.out.println("Your Package Is removed By Your Child");
System.out.println("Your Package Is removed By Your Child");
System.out.println("Your Package Is removed By Your Child");
System.out.println("Your Package Is removed By Your Child");
System.out.println("Your Package Is removed By Your Child");
System.out.println("Your Package Is removed By Your Child");
System.out.println("Your Package Is removed By Your Child");
SendSms(context);
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
Thanks
Upvotes: 1
Views: 158
Reputation: 10028
I think it would be kinda illogical to expect your application to receive a notification when it gets uninstalled, because "un-installation" implies removal of your application from disk, which starts with killing the application if its running.
Check here: http://developer.android.com/reference/android/content/Intent.html#ACTION_PACKAGE_REMOVED
Upvotes: 1