Code example for DevicePolicyManager

Methods: isAdminActivewipeData

0
	private void wipePhone() { 
		Log.d(TAG, "Wiping device...");
		 
		ComponentName componentName = new ComponentName(this, AdminReceiver.class);
		DevicePolicyManager devicePolicyManager = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
		if (!devicePolicyManager.isAdminActive(componentName)) {
			Log.w(TAG, "Can not wipe device: device admin is not active!");
			return; 
		} 
		 
		devicePolicyManager.wipeData(0);
	} 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE