1
我是一名Android編程初學者。 下面是拍攝圖像並將其保存在SD卡中的文件夾中的代碼。圖像保存在圖庫中,但未保存在我想要的位置。請幫助...無法將圖片保存到指定位置
public class CameraActivity extends Activity {
/** Called when the activity is first created. */
Button button1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
button1=(Button)findViewById(R.id.button1);
}
public void send(View v)
{
Intent imageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File imagesFolder = new File(
Environment.getExternalStorageDirectory(),
"MyImages");
imagesFolder.mkdirs(); //
File image = new File(imagesFolder, "image_001.jpg");
Uri uriSavedImage = Uri.fromFile(image);
imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
startActivityForResult(imageIntent,0);
}
}
目錄,但畫面依然不會保存在的位置。它只保存在畫廊中, – Sourav301 2012-07-05 17:59:11