问题
I've been trying to create an app that reads a TXT file from downloads internal storage and puts it into an ArrayList and writes an excel sheet to downloads internal storage from in android but android 10 isn't allowing me to read or write a file. I have already used Environment.getExternalStorageDirectory() but it keeps getting deprecated. Do you guys have any tips or know anyways out of this.
回答1:
use context.getExternalFilesDir()
or context.getExternalCacheDir()
,these also work in 10. See https://developer.android.com/training/data-storage
来源:https://stackoverflow.com/questions/59290061/how-to-i-read-and-write-a-txt-file-from-android-10-and-above-from-internal-stora