Here's what: I am making a security application that should check if a PIN is set or not. The official API returns the same value regardless of the state of the PIN, and I experimented with ITelephony, but I can not get it to work. Any help please?
Workaround!
@override protected void onPause() { super.onPause(); PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); boolean isScreenOn = powerManager.isScreenOn(); if (!isScreenOn) { // do stuff... } }