萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> 安卓開發 >> Android 修改Camera拍照的默認保存路徑

Android 修改Camera拍照的默認保存路徑

   Camera拍照的默認保存路徑的修改方法為, 打開storage.java

  將:

  public static void updateDefaultDirectory(Activity activity, boolean stillCapture) {

  String defaultPath = StorageManager.getDefaultPath();

  MOUNT_POINT = defaultPath;

  Log.i(TAG, "Write default path =" + defaultPath);

  if (Util.CU) {

  DCIM = stillCapture ? (MOUNT_POINT + "/Photo") : (MOUNT_POINT + "/Video");

  DIRECTORY = DCIM;

  } else {

  DCIM = MOUNT_POINT + "/DCIM";

  DIRECTORY = DCIM + "/Camera";

  }

  BUCKET_ID = String.valueOf(DIRECTORY.toLowerCase().hashCode());

  中的DIRECTORY=DCIM+”/Camera” 改為DIRECTORY = 您想要的目錄名;

  做完以上修改後,拍的照片就會默認保存在您定義的目錄下.

copyright © 萬盛學電腦網 all rights reserved