我在App卸载中遇到问题。我的应用需求是当用户想要进行应用程序卸载时,请打开登录屏幕。当用户按右侧密码,然后显示卸载应用程序系统警报。并且警报有两个条件(1)好的 (2)取消。当用户单击“确定”,然后应用程序正确卸载。当App Uninstalled正确时,他们得到一个类似“android.intent.action.PACKAGE_REMOVED”的BroadcastReciver。如果用户单击取消按钮“如何在Android中获取任何BroadcastReciver或通知”。
公共类CustomBroadcastReceiver扩展了BroadcastReceiver {
/**
* This method captures the event when a package has been removed
*/
@SuppressWarnings("static-access")
@Override
public void onReceive(Context context, Intent intent)
{
System.out.println("Hello from CustomBroadcastReceiver");
if (intent != null) {
String action = intent.getAction();
System.out.println("L1123 : "+action);
if (intent.getAction().equals("android.intent.action.PACKAGE_REMOVED"))
{
SMContants.Removed_Apps=true;
//Log the event capture in the log file ...
SMContants.App_uninstalled=false; /// Important Line
System.out.println("The package has been removed");
}
else
{
SMContants.App_uninstalled=false;
}
}
}
}
当我写一条重要的线条时
我希望当用户点击取消按钮然后点击变量值
SMContants.App_uninstalled = FALSE;
我们如何获取应用卸载取消按钮事件