Reputation: 60
How to start an Activity or an IntentService before an application will be uninstalled by the user who has earlier installed the app on there device?
Upvotes: 1
Views: 1990
Reputation: 1585
One way to achieve what you want would include the following steps:
There is no such thing as impossible with computers. There is only difficult and highly improbable to happen anytime soon. This is a fact not an opinion. Often someone says "impossible" and there is someone interrupting them saying "Just did it.".
Upvotes: 1
Reputation: 8030
You cannot prefend an user removing an application.
The DELETE intent will be send when the user requests to uninstall. The PackageManager will receive this intent and start uninstalling the application.
So, without any Android modifications, you cannot add an password.
Upvotes: 0
Reputation: 125
You have to use Intent filter called "android.intent.action.DELETE" in the AndroidManifest.xml Like below
<activity
android:name=".Activity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DELETE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="package" />
</intent-filter>
</activity>
This will call the activity.
Upvotes: 0