调整应用初始化时的默认相册路径

This commit is contained in:
2026-04-25 05:57:46 +08:00
parent 2f14443624
commit ecad4a7913
3 changed files with 5 additions and 5 deletions

View File

@@ -138,9 +138,9 @@ public class MainActivity extends AppCompatActivity {
LogUtils.d(TAG, "baseFolder: " + baseFolder.getAbsolutePath() + ", exists=" + baseFolder.exists());
if (!baseFolder.exists() || !baseFolder.isDirectory()) {
folderPath = Environment.getExternalStorageDirectory() + "/DCIM";
folderPath = Preferences.getDefaultPath();
baseFolder = new File(folderPath);
LogUtils.d(TAG, "try DCIM: " + baseFolder.getAbsolutePath() + ", exists=" + baseFolder.exists());
LogUtils.d(TAG, "try default: " + baseFolder.getAbsolutePath() + ", exists=" + baseFolder.exists());
if (!baseFolder.exists()) {
folderPath = Environment.getExternalStorageDirectory() + "/Pictures";
baseFolder = new File(folderPath);

View File

@@ -8,7 +8,7 @@ public class Preferences {
public static final String TAG = "Preferences";
private static final String PREF_NAME = "gallery_prefs";
private static final String KEY_FOLDER_PATH = "folder_path";
private static final String DEFAULT_PATH = "/storage/emulated/0/DCIM";
private static final String DEFAULT_PATH = "/storage/emulated/0/Pictures/Gallery/owner";
public static String getDefaultPath() {
return DEFAULT_PATH;