Grymfogel1
Grymfogel1

Reputation: 127

Method to check if phone screen is on or not

I'm trying to have an Xposed module check (on hardware button press) whether the phone screen is on or not. How would I do this, is there any method to check this? Thanks. EDIT: This needs to work on API 17 or more.

Upvotes: 2

Views: 145

Answers (1)

Adam
Adam

Reputation: 2440

For any API under 20, you can use IsScreenOn().

For API 20+, you can use IsInteractive() as IsScreenOn was deprecated in API 20.

Upvotes: 2

Related Questions