DevicePolicyManager wipeData - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DevicePolicyManager wipeData method.

This code example shows how to use the following methods:isAdminActive, wipeData
                                    + "This WILL erase all of your data!  " 
                                    + "Are you really absolutely sure?"); 
                        } 
                        builder.setPositiveButton("BOOM!", new DialogInterface.OnClickListener() { 
                            public void onClick(DialogInterface dialog, int which) { 
                                boolean active = mDPM.isAdminActive(mDeviceAdminSample); 
                                if (active) { 
                                    mDPM.wipeData(v == mWipeAllDataButton 
                                            ? DevicePolicyManager.WIPE_EXTERNAL_STORAGE : 0); 
                                } 
                            } 
                        }); 
                        builder.setNegativeButton("Oops, run away!", null); 
                        builder.show(); 
                    } 
                }); 
                builder.setNegativeButton("No way!", null); 
                builder.show(); 
            } 
        }; 
5
CodeRank
This code example shows how to use the following methods:isAdminActive, wipeData
	static public boolean performWipe(Context context) {
		 
		mDPM = Menu.getDPM();
		mDeviceAdmin = Menu.getDAS();
		 
		boolean active = mDPM.isAdminActive(mDeviceAdmin);
        if (active) 
        { 
        	mDPM.wipeData(0);
        } 
        else 
        { 
        	return false; 
        } 
	 
		return true; 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:isAdminActive, wipeData
	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);
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:isAdminActive, wipeData
	static public boolean performWipe(Context context) {
		 
		mDPM = Menu.getDPM();
		mDeviceAdmin = Menu.getDAS();
		 
		boolean active = mDPM.isAdminActive(mDeviceAdmin);
        if (active) 
        { 
        	mDPM.wipeData(0);
        } 
        else 
        { 
        	return false; 
        } 
	 
		return true; 
	} 
} 
5
CodeRank
wipeData Method Overview
Ask the user date be wiped.
See Code Examples for other Android DevicePolicyManager Methods: