Code example for DevicePolicyManager

Methods: isAdminActivelockNow

        private OnClickListener mForceLockListener = new OnClickListener() {
            public void onClick(View v) { 
                if (mAM.isUserAMonkey()) { 
                    // Don't trust monkeys to do the right thing! 
                    AlertDialog.Builder builder = new AlertDialog.Builder(Controller.this); 
                    builder.setMessage("You can't lock my screen because you are a monkey!"); 
                    builder.setPositiveButton("I admit defeat", null); 
                boolean active = mDPM.isAdminActive(mDeviceAdminSample); 
                if (active) { 
        private OnClickListener mWipeDataListener = new OnClickListener() {
            public void onClick(final View v) { 
                if (mAM.isUserAMonkey()) { 
Contextual code suggestions in your IDE  Get Codota for Java