buder

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

posted on   buder  阅读(107)  评论(0编辑  收藏  举报

导航

统计信息

点击右上角即可分享
微信分享提示