0

I have code to delete the contact group with the contact group id like this and is also working...

ContentValues values = new ContentValues();         
values.put(ContactsContract.Groups._ID, 4444);
getContentResolver().delete(ContactsContract.Groups.CONTENT_URI,values.toString(),null);

but I want to perform this deletion at the time of un-installation of the application in Android device.So what I have to do or which function can be used at uninstalling time?

So can you suggest me something?

user370305
  • 108,599
  • 23
  • 164
  • 151
Rushabh Patel
  • 3,052
  • 4
  • 26
  • 58
  • Did you get control when your application un-installed? I don't think you can! If yes, then its nice to you for your efforts.... – user370305 Dec 20 '11 at 10:43

1 Answers1

1

Sorry, You cannot get control or perform any task when your application is uninstalled.

Unfortunately there is currently no way for an Android package to execute code when it is removed. However, you can register a BroadcastReceiver for ACTION_PACKAGE_REMOVED in a different package that will be called when packages are removed from the phone.

Look at this question Perform a task on uninstall in android

Community
  • 1
  • 1
user370305
  • 108,599
  • 23
  • 164
  • 151