此代码在 SD 卡中创建文件夹,但不将图像保存在该文件夹中,我该怎么做?是在默认凝胶中显示图像我想将图像保存在我的“myfolder23”中而不是默认凝胶中我是怎么做到的???我如何只将相机拍摄的图像保存在“myfolder23”而不是默认的gellry文件夹中?或者从默认的gellery中删除只保存在“myfolder23”中???
private void startDialog() {
AlertDialog.Builder myAlertDialog = new AlertDialog.Builder(this);
myAlertDialog.setTitle("Upload Pictures Option");
myAlertDialog.setMessage("How do you want to set your picture?");
myAlertDialog.setPositiveButton("Gallery", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
pictureActionIntent = new Intent(Intent.ACTION_GET_CONTENT,
null);
pictureActionIntent.setType("image/*");
pictureActionIntent.putExtra("return-data", true);
startActivityForResult(pictureActionIntent, GALLERY_PICTURE);
}
});
myAlertDialog.setNegativeButton("Camera", new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
pictureActionIntent = new
Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
String newFolder = "/myFolder23";
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
File file = new File(extStorageDirectory + newFolder);
file.mkdir();
Uri outputFileUri = Uri.fromFile(file);
pictureActionIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(pictureActionIntent, CAMERA_PICTURE);
}
});
myAlertDialog.show();
}