I am unable to get the Activity which allows the user to grant permission for an app to be a device admin to work.
My code is as follows...
ComponentName comp = new ComponentName(this, CustomReceiver.class);
Intent i = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
i.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, comp);
i.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, "Explanation");
startActivity(i);
The application does not crash / report an exception. What could I be doing wrong ?