3

Here's the thing - I'm doing a security app that needs to be able to check if the PIN code is set or not. The official API returns the same value regardless of the PIN state, and I've been experimenting with ITelephony, but can't seem to get it to work. Any help, please?

1 Answer 1

-1

Workaround!

@override
protected void onPause() {
  super.onPause();
  PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
  boolean isScreenOn = powerManager.isScreenOn();
  if (!isScreenOn) {
    // do stuff...
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.