How Do We Distinguish Never-Asked From Stop-Asking in Android M's Runtime Permissions?

后端 未结 10 660
萌比男神i
萌比男神i 2020-11-28 20:48

When it comes to the M Developer Preview runtime permissions, according to Google:

  1. If you have never asked for a certain permission before, just ask for it<

10条回答
  •  执笔经年
    2020-11-28 21:28

    You can look here - there is a flowchart that explains the process quite good. It also explains when you should call shouldShowRequestPermissionRationale() and when it returns true.

    Basically according to Android's documentation, you should always ask for permission if you don't have it (Android will automatically return DENIED in the callback if the user said to never ask again) and you should display a short message if the user has already declined you once in the past but hasn't marked the never ask again option.

提交回复
热议问题