How to enable screen overlay permission by default

后端 未结 5 498
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-18 04:38

How can I enable screen overlay permission by default while install application.

Now I facing some problem, when capture image asking run time permission some device

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-18 05:17

    You have to leave your activity in order to get permission to draw your screen above some other activities. That is something you cannot avoid.

    In order to do that, you have to visit Settings via ACTION_MANAGE_OVERLAY_PERMISSION intent. Since you would like to have an user-friendly app, at the moment you need to ask for such permission, fire some dialog with explanation why you need that and with option for to accept and decline your requirement. On accept, fire the intent and start activity.

提交回复
热议问题