I found how to detect uninstall event and test following code.
In Receiver.java:
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.d(TAG, "received broadcast : " + action);
}
In manifest.xml:
<receiver android:name="....base.BaseAppReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
But it detected when only other app was uninstalled. I want to do something before uninstalling "my" app not "other" app. Please, Let me know how can my app detect uninstalling event for processing something before uninstalling my app if it can.
This is not possible, sorry. If you put your files in the proper directories, they will be deleted automatically, but no other work can be done when your app is uninstalled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With