1 // /storage/emulated/0 2 // sc卡根路径,卸载时会保留 3 File f1 = Environment.getExternalStorageDirectory(); 4 Log.e("Main", f1.getAbsolutePath()); 5 6 // /storage/emulated/0/Music 7 File f2 = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC); 8 Log.e("Main", f2.getAbsolutePath()); 9 10 // /data/data/com.dhn.test/files 11 File f3 = getFilesDir(); 12 Log.e("Main", f3.getAbsolutePath()); 13 14 File f4 = getCacheDir(); 15 Log.e("Main", f4.getAbsolutePath()); 16 17 // /storage/emulated/0/Android/data/com.dhn.test/files/Music 18 // 在SD卡中,卸载时会被删除 19 File f5 = getExternalFilesDir(Environment.DIRECTORY_MUSIC); 20 Log.e("Main", f5.getAbsolutePath());
原文:http://www.cnblogs.com/gatsbydhn/p/5175298.html