我發現如何檢測卸載事件並測試下面的代碼。在卸載我的android應用程序之前,我該怎麼做?
在Receiver.java:
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
Log.d(TAG, "received broadcast : " + action);
}
在的manifest.xml:
<receiver android:name="....base.BaseAppReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
但檢測時只其他應用程序卸載。 我想在卸載「我的」應用程序而不是「其他」應用程序之前做一些事情。 請讓我知道我的應用程序如何檢測卸載事件處理的東西,然後再卸載我的應用程序,如果可以的話。
你能改說你的問題嗎? – Espanta