android 监听程序卸载
来源:互联网 发布:如何举报淘宝店铺侵权 编辑:程序博客网 时间:2024/04/30 06:30
1, 定义一个class 继承BroadcastReceiver;
2, 给Receiver注册广播;
UninstallApp receiver = new UninstallApp(); IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_INSTALL); filter.addAction(Intent.ACTION_PACKAGE_REMOVED); filter.addDataScheme("package"); //This line is very important. Otherwise, broadcast can't be received.这一行很得要 registerReceiver(receiver, filter);
2、XML
This line is very important. Otherwise, broadcast can't be received. 这一行很重要
Java代码
< receiver Android:name="UninstallApp"> < intent-filter> < action android:name="android.intent.action.PACKAGE_REMOVED" /> < data android:scheme="package"> < /intent-filter> < /receiver> < receiver android:name="UninstallApp"> < intent-filter> < action android:name="android.intent.action.PACKAGE_REMOVED" /> < data android:scheme="package"> < /intent-filter> < /receiver>
Java代码
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class UninstallApp extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Log.e("intent", "intent="+intent.getAction()); } }
- android 监听程序卸载
- android监听程序安装、卸载
- android 监听程序的监听和卸载
- Android监听自身的程序被卸载
- Android监听程序的安装和卸载
- Android 监听程序的安装和卸载
- Android 监听程序的安装和卸载
- Android 监听程序的安装和卸载
- Android监听程序自身被卸载
- Android监听程序的安装和卸载
- Android监听程序的安装和卸载
- Android 监听程序的安装和卸载
- Android监听程序的安装和卸载
- Android 监听程序的安装、卸载、替换
- Android监听应用程序安装和卸载实现程序
- Android监听应用程序安装和卸载实现程序
- Android监听自身的程序被卸载-LOG监视
- Android 监听应用卸载
- java学习笔记:getPath取路径文件夹中有空格的处理方法
- native-maven-plugin与maven-nar-plugin配置
- vim设置默认配色方案
- 使用PULL解析XML文件
- MySQL InnoDB 存储引擎 count加速
- android 监听程序卸载
- Windows文件系统的杂谈
- POJ-1840(解五元三次方程-hash)
- java读取pdf文件内容
- 重写了书法字典
- Ubuntu下SSH远程连接
- android 让多余的文字不显示
- <Android应用开发之二>Spinner、AutoCompleteTextView、MultiAutoCompleteTextView使用方法
- FLEX中Tree默认展开所有节点