在Fragment中注册BroadcastReceiver时,触发广播会发生 java.lang.IllegalStateException: Fragment already added
在注册BroadcastReceiver时,添加
filter.addAction(Intent.ACTION_PACKAGE_ADDED);
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
就OK了