i want to set 2 minutes of user inactivity that can occur before the device locks using setMaximumTimeToLock.
DevicePolicyManager mDPM;
ComponentName mDeviceAdminSample;
...
long timeMs = 1000*60*2;
mDP开发者_运维技巧M.setMaximumTimeToLock(mDeviceAdminSample, timeMs);
but the above code is not working. please tell the suitable one.
thanks.
Have you implemented a DeviceAdminReceiver?
This answer says it is necessary:
Locking an android phone (lock pattern or similar)
精彩评论