Orwa Ra
Orwa Ra

Reputation: 103

How to show power menu programmatically in Android

i want to show the power dialog to turn off or restart the device , i found some apps in the play store , it seems they are using accessibility services , but i can't figure how to do it , anyone have any idea how to implement this ?

this is what i want to show :

Power Dialog

Upvotes: 1

Views: 943

Answers (1)

Philipp Schumann
Philipp Schumann

Reputation: 1780

You can define an accessibility service and call

performGlobalAction(GLOBAL_ACTION_POWER_DIALOG)

This Google codelab will guide you through it: https://codelabs.developers.google.com/codelabs/developing-android-a11y-service/#0

Upvotes: 1

Related Questions