Android examples for Hardware:Device Feature
is Device Manager Active
//package com.java2s; import android.app.admin.DeviceAdminReceiver; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; public class Main { public static boolean isDeviceManagerActive(Context context, Class<? extends DeviceAdminReceiver> cls) { DevicePolicyManager dpm = (DevicePolicyManager) context .getSystemService(Context.DEVICE_POLICY_SERVICE); ComponentName receiver = new ComponentName(context, cls); return dpm.isAdminActive(receiver); }//from w ww.j a va2s . c o m }