I added an activity with an intent filter to intercept the uninstall of my app so I can add some additional processing/cleanup when a user uninstalls my app. My activity get called just fine but I seem unable to complete the removal of the package from the device.
<activity
android:name=".Uninstall"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.DELETE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="package" />
</intent-filter>
</activity>
When I use the package manager to try to complete the uninstall it just pops up the same chooser dialog.
Intent intent = new Intent(Intent.ACTION_DELETE, Uri.fromParts("package", Uninstall.this.getPackageName(), null));
startActivity(intent);
If I am providing an alternative uninstall activity for my app how do I complete the actual uninstall of the apk from the device?
Thanks.