简体   繁体   中英

Is there a path in the Emulator that can be programmatically written when the permission is denied?

In the lower Android version, /sdcard/Download can be read and written, but from Android6 when I use code File file = new File("/sdcard/Download/TestResults.xls"); it will throw exception permission denied, I want to find are there a path in emulator that jave code can directly use to create File without asking permission?

Android-M ie, API 23 introduced Runtime Permissions for reducing security flaws in android device, where users can now directly manage app permissions at runtime.

You should to use permission API version above 23.

Refer this Android marshmallow request permission?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM