听着广播在应用程序卸载 [英] Listen Broadcast Before application uninstall

查看:144
本文介绍了听着广播在应用程序卸载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了防病毒平均值为测试目的。
测试后,当我试图卸载防病毒,防病毒,促使我说,'你确定要删除这个应用程序吗?。
这提示屏幕由防病毒应用程序产生的。该屏幕后,我得到了系统的提示与确定和取消按钮。所以,这提示放入防病毒应用程序。

I have installed Avg Antivirus for testing purpose.
After Testing when I have tried to uninstall that Antivirus,Antivirus has prompted me that 'are you sure you want to remove this application?'.
That prompt screen is generated by antivirus application. After that screen I got System prompt with OK and CANCEL Button. so, That prompt was put by antivirus application.

现在我的问题是...

Now my question is...

我怎样才能把提示屏幕,用户在我的应用程序一样的解释上面? 我知道 android.intent.action.PACKAGE_REMOVED ,但收到申请后已完全卸载。

How can I put prompt screen for user in my application as same as explain above? I know about "android.intent.action.PACKAGE_REMOVED" but it received after application has been fully uninstall.

任何帮助是AP preciated。

Any help is appreciated.

感谢你。

推荐答案

我添加下面的意图过滤器,现在我收到来选择活动的对话框。我想你应该有这个过滤器来显示你的活动(特别是与过滤器的数据部分)播放。                         

I've added the following intent-filter and now I receive the dialog to chose activity. I think you should play with this filter to display your activity (especially with data part of the filter).

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".UninstallIntentActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <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>

</application>

这篇关于听着广播在应用程序卸载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆