当前位置:网站首页>Method of accessing mobile phone storage location permission under non root condition
Method of accessing mobile phone storage location permission under non root condition
2022-07-06 18:40:00 【Chenfuxu】
1.Manifest Apply for permission to read and write external files
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>2. The higher version requires dynamic permission application
int checkReadExternalPermission = checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE);
int checkWriteExternalPermission = checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (checkReadExternalPermission != PackageManager.PERMISSION_GRANTED || checkWriteExternalPermission != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0x01);
}3. If an error is reported and the file cannot be accessed , stay application Add
android:requestLegacyExternalStorage="true"
4. Note that sometimes the file cannot be read or written successfully because the file memory is too large
边栏推荐
- 关于npm install 报错问题 error 1
- 具体说明 Flume介绍、安装和配置
- A method of sequentially loading Unity Resources
- 30 minutes to understand PCA principal component analysis
- 文档编辑之markdown语法(typora)
- Jdbc driver, c3p0, druid and jdbctemplate dependent jar packages
- Xu Xiang's wife Ying Ying responded to the "stock review": she wrote it!
- SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
- Penetration test information collection - basic enterprise information
- How does crmeb mall system help marketing?
猜你喜欢

Docker installation redis

C#/VB.NET 给PDF文档添加文本/图像水印
![[the 300th weekly match of leetcode]](/img/a7/16b491656863e2c423ff657ac6e9c5.png)
[the 300th weekly match of leetcode]

44 colleges and universities were selected! Publicity of distributed intelligent computing project list

Breadth first traversal of graph

当保存参数使用结构体时必备的开发技巧方式

基于ppg和fft神经网络的光学血压估计【翻译】

Splay

There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed

爬虫玩得好,牢饭吃到饱?这3条底线千万不能碰!
随机推荐
测试行业的小伙伴,有问题可以找我哈。菜鸟一枚~
UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
C语言高校实验室预约登记系统
Windows connects redis installed on Linux
Distill knowledge from the interaction model! China University of science and Technology & meituan proposed virt, which combines the efficiency of the two tower model and the performance of the intera
There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed
Stm32+mfrc522 completes IC card number reading, password modification, data reading and writing
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability
Hongke shares | plate by plate ar application in Beijing Winter Olympics
巨杉数据库首批入选金融信创解决方案!
287. Find duplicates
Nuc11 cheetah Canyon setting U disk startup
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
【剑指 Offer】 60. n个骰子的点数
UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
随着MapReduce job实现去加重,多种输出文件夹
图之广度优先遍历
44 colleges and universities were selected! Publicity of distributed intelligent computing project list
复现Thinkphp 2.x 任意代码执行漏洞
文档编辑之markdown语法(typora)