Android Wear System Alert Window Permission

294 views Asked by At

How to ask for system alert window permission on Android Wear? I am able to achieve the SYSTEM ALERT WINDOW for mobile but on the wearable device same code is not working for me. If any example of SYSTEM ALERT WINDOW for wearable would help me a lot.

2

There are 2 answers

0
Sterling On

This is a duplicate of Requesting permissions on Android wear, but SO won't let me mark it as such because the OP didn't accept my answer there.

The summary is that it's not possible to request this permission on Android Wear 1.x, but it is on Wear 2 (currently in beta and slated for release in early 2017).

0
Teyam On

In addition to @String's answer, you might want to use requestPermissions() method. Please note, these permissions must be requested in your manifest.

And, as mentioned in Permissions for Services,

only an activity can call the requestPermissions() method, so if the user interacts with your app via a service, for example a watch face, the service must open a background activity before requesting the permission.

You can gain additional insights from the solutions given in this SO post and from the sample code shown in this GitHub post.