Try  HackMD Logo HackMD

Android Studio 權限問題

Android 6 ~ 9

第一次訊問會出現

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

第二之後訊問會出現,多了「不要再詢問」的選項
此時有兩種狀況:

  1. 不打勾情況下,按「拒絕」,只要每次詢問權限問題,都一定會再跳出來。但 Android 10以上不會,切記。
  2. 勾了之後,就只能提示使用者到設定頁啟動權限,就不會再出現提示。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Android 10 以上,「11以上」會出現單次授權

沒有一次性的功能

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

有一次性的,如GPS、相機,會出現只允許這一次使用。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

只要拒絕兩次,之後,就只能提示使用者到設定頁啟動權限,就不會再出現提示。

未來提供程式碼,目前還在測試中。

參考資料

https://developer.android.com/training/permissions/requesting

tags: Android Studio permission