我開始學習將文件寫入SD卡。然而,我需要一些澄清,因爲我不明白爲什麼我在getAbsolutePath()(這是由Android工作室檢測到)的錯誤。getAbsolutePath() - 無法解析方法 - Android工作室
public class AndroidFileIO implements FileIO {
Context context;
AssetManager assets;
String externalStoragePath;
public AndroidFileIO(Context context) {
this.context = context;
this.assets = context.getAssets();
this.externalStoragePath = Environment.getExternalStorageState().getAbsolutePath()
+ File.separator;
}
謝謝
使用'getExternalStorageDirectory()''而不是getExternalStorageState()' – Raghunandan