2011-12-26 62 views
17

我已安装Avg Antivirus以进行测试。
经过测试当我试图卸载该防病毒软件时,Antivirus已经提示我“你确定要删除这个应用程序吗?”。
该提示屏幕由防病毒应用程序生成。在该屏幕之后,我通过OK和CANCEL按钮获得了系统提示。所以,该提示被反病毒应用程序放置。收听广播在应用程序卸载之前

现在我的问题是...

我怎样才能把提示屏幕,用户在我的应用程序同上解释一下吗? 我知道“android.intent.action.PACKAGE_REMOVED”但它在应用程序完全卸载后收到。

任何帮助表示赞赏。

谢谢。

回答

14

我已经添加了以下intent-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> 
+0

它工作正常,但我卸载所有活动中不想要的。我想为特定的活动卸载时间。而且我不想接收安装包装程序和我的应用程序选项的对话框。 –

+0

没有修改源代码我认为这是不可能实现 – Yury

+2

使用''来过滤特定的包删除意图 – barmaley