Do I have to declare both WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE?

前端 未结 2 1064
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 15:54

Is it enough to declare or do I also have to declare

2条回答
  •  眼角桃花
    2020-12-15 16:31

    READ_EXTERNAL_STORAGE only exists as of Jelly Bean (Level 16). According to the docs, all applications as of Jelly Bean have that permission, even without declaring it:

    Provides protected read access to external storage. In Android 4.1 by default all applications still have read access. This will be changed in a future release to require that applications explicitly request read access using this permission. If your application already requests write access, it will automatically get read access as well. There is a new developer option to turn on read access restriction, for developers to test their applications against how Android will behave in the future.

    So, you should declare it for future compatibility, but this might not be the source of your problem, unless you're using a Jelly Bean phone and set the developer option "Protect USB storage" option.

提交回复
热议问题