AndroidUtilCode icon indicating copy to clipboard operation
AndroidUtilCode copied to clipboard

Help Needed: how to use readFile2String

Open cs-usst opened this issue 3 years ago • 1 comments
trafficstars

Describe the feature

How to use FileIOUtils.readFile2String function? I wrote this:

String externalString = PathUtils.getExternalStoragePath();
String testFileString = FileIOUtils.readFile2String(PathUtils.join(externalString,"test.txt"));
# i also tried:
String testFileString = FileIOUtils.readFile2String("/storage/emulated/0/test.txt");

And the testFileString is null. Could anyone tell me why? Thanks.

Reference

None

cs-usst avatar May 29 '22 08:05 cs-usst

Maybe you don't have the permission to read the file from the '/storage/emulated/0/' dir.

shouzhong avatar Jul 27 '22 08:07 shouzhong