2017-12-12
1.监听应用安装广播
静态:
<receiver android:name="PackageActionsReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REPLACED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" /> <!-- HERE! -->
</intent-filter>
</receiver>
动态:
@Override
public void onStart(){
super.onStart();
installedReceiver = new MyInstalledReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction("android.intent.action.PACKAGE_ADDED");
filter.addAction("android.intent.action.PACKAGE_REMOVED");
filter.addDataScheme("package");
this.registerReceiver(installedReceiver, filter);
}
@Override
public void onDestroy(){
if(installedReceiver != null) {
this.unregisterReceiver(installedReceiver);
}
super.onDestroy();
}
public class MyInstalledReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals("android.intent.action.PACKAGE_ADDED")) { // install
String packageName = intent.getDataString();
Log.i("homer", "安装了 :" + packageName);
}
if (intent.getAction().equals("android.intent.action.PACKAGE_REMOVED")) { // uninstall
String packageName = intent.getDataString();
Log.i("homer", "卸载了 :" + packageName);
}
}
}
2.handlerthread
3.四大组件安全问题
4.activity-alias用法示例
http://blog.csdn.net/ahence/article/details/51648768
5.
LOCAL_MOUDLE_PATH
http://blog.csdn.net/newairzhang/article/details/50631311
LOCAL_DEX_PREOPT
http://blog.csdn.net/u011913612/article/details/51853502
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】博客园携手 AI 驱动开发工具商 Chat2DB 推出联合终身会员
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步