androidcontactscontactgroups

do not get the notification at the time of uninstalling the apps using on receive() method


mine code into ApplicationBroadcastService.class file is :

public class ApplicationBroadcastService extends BroadcastReceiver{
@Override   
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Activity a=new Activity();
Toast.makeText(context, " Uninstall  ", Toast.LENGTH_LONG).show();
ContentValues values = new ContentValues();         
values.put(ContactsContract.Groups._ID, 4444);
a.getContentResolver().delete(ContactsContract.Groups.CONTENT_URI,
values.toString(),null)
}
}

and in menifest.xml code is :

<receiver android:name=".ApplicationBroadcastService">
    <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
            <action android:name="android.intent.action.PACKAGE_ADDED"  />
            <action android:name="android.intent.action.PACKAGE_CHANGED" />
            <action android:name="android.intent.action.PACKAGE_INSTALL" />
            <action android:name="android.intent.action.PACKAGE_REMOVED" />
            <action android:name="android.intent.action.PACKAGE_REPLACED" />
            <data android:scheme="package" />
    </intent-filter>
</receiver>

but when i am uninstalling the application i do not receive any notification. actually i want to delete contact group that is created at installation time in the on receive notification. any suggestion for that?


Solution

  • I Have also done Research on this thing and finally get conclusion that there is no way to get event of uninstallation of particular application within the application . This is a security reason that android do not provide that. But you can get some events in other application which in not being installed.