当前位置:网站首页>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
边栏推荐
猜你喜欢

小程序在产业互联网中的作用

Self supervised heterogeneous graph neural network with CO comparative learning
![[Matlab] Simulink 同一模块的输入输出的变量不能同名](/img/99/adfe50075010916439cd053b8f04c7.png)
[Matlab] Simulink 同一模块的输入输出的变量不能同名

SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍

287. Find duplicates

Tree-LSTM的一些理解以及DGL代码实现

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

Recommend easy-to-use backstage management scaffolding, everyone open source

十、进程管理

Medical image segmentation
随机推荐
ORACLE进阶(四)表连接讲解
华为0基金会——图片整理
287. Find duplicates
Blue Bridge Cup real question: one question with clear code, master three codes
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
Maixll dock camera usage
Grafana 9.0 is officially released! It's the strongest!
Excel usage record
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability
Bonecp uses data sources
C语言高校实验室预约登记系统
Self supervised heterogeneous graph neural network with CO comparative learning
SQL injection - access injection, access offset injection
POJ 2208 six lengths of tetrahedron are known, and the volume is calculated
Top command details
Easy to use PDF to SVG program
The third season of Baidu online AI competition is coming in midsummer, looking for you who love AI!
CSRF漏洞分析
使用block实现两个页面之间的传统价值观
安装及管理程序