<receiver android:name="com.android.server.MasterClearReceiver" android:permission="android.permission.MASTER_CLEAR"> <intent-filter android:priority="100" > <!-- For Checkin, Settings, etc.: action=FACTORY_RESET --> <action android:name="android.intent.action.FACTORY_RESET" /> <!-- As ab...
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR")); } else { Intent intent = new Intent("android.intent.action.FACTORY_RESET"); intent.setPackage("android"); sendBroadcast(intent); } 1. 2. 3. 4. 5. 6. 7. 注:添加...
android FactoryReset private void doMasterClear() { Intent intent = new Intent(Intent.ACTION_FACTORY_RESET); intent.setPackage("android"); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_REASON, "MasterClearConfirm"); intent.putExtra(Intent.EXTRA_WIPE_EXTERNAL_STORAGE,...
-- For Checkin, Settings, etc.: action=MASTER_CLEAR --> <action android:name="android.intent.action.MASTER_CLEAR" /> <!-- MCS always uses REMOTE_INTENT: category=MASTER_CLEAR --> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="android.intent.ca...
context.startActivity(intent); } /** * 恢复出厂默认命令,设备会发生重启 */ public void reset(){ Intent intent =new Intent(getIntentAction("android.content.Intent", "ACTION_FACTORY_RESET")); intent.setPackage("android"); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); ...
ACTION_PICK_ACTIVITY为已知的Intent选择一个Activity,返回别选中的类 ACTION_SEARCH执行一次搜索 ACTION_WEB_SEARCH执行一次web搜索 ACTION_FACTORY_TEST工场测试的主要进入点, 标准的广播Actions ACTION_TIME_TICK当前时间改变,每分钟都发送,不能通过组件声明来接收,只有通过Context.registerReceiver()方法来注册 ...
android.permission.REBOOTSettings发送广播privatevoiddoMasterClear(){Intentintent=newIntent(Intent.ACTION_MASTER_CLEAR);intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);intent.putExtra(Intent.EXTRA_REASON,"MasterClearConfirm");intent.putExtra(Intent.EXTRA_WIPE_EXTERNAL_STORAGE,mEraseSdCard);getActivity().send...
Intent intent =newIntent(Intent.ACTION_SHUTDOWN); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND | Intent.FLAG_RECEIVER_REGISTERED_ONLY); // 发送 有序的 关机广播 mContext.sendOrderedBroadcastAsUser(intent, UserHandle.ALL,null, br, mHandler,0,null,null); ...
A、是用来接收广播 Intent B、一个广播 Intent 只能被一个订阅了此广播的 BroadcastReceiver 所接收 C、对有序广播,系统会根据接受者声明的优先级别按顺序逐个执行接收者 D、接收者生命的优先级别在 android:priority 属性中生命数值越大优先级别高 6、Intent 组件的 Action 为()表示是程序的入口 A、ACTION_VIEW...
Intent intent = new Intent(Intent.ACTION_FACTORY_RESET);// intent.setPackage("android"); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_REASON, "MasterClearConfirm"); intent.putExtra(Intent.EXTRA_WIPE_EXTERNAL_STORAGE, mEraseSdCard); ...