我想将捕获的图像保存在我的应用程序内存中并在 gridview 中查看,但是当我捕获图像时崩溃我该怎么办?我如何解码捕获的图像?我想将捕获的图像保存在我的应用程序内存中(“data/data/com.myexample/files\CameraRoll\”);我该怎么办?请帮我
Private final int CAMERA_PICTURE=1;
public final String IMAGE_CAPTURE_NAME=System.currentTimeMillis()+".jpeg";
File Cameraroll =new file(getFileDir(),"CameraRoll");
if(CameraRoll.esixts() && CameraRoll.isDirectory())
{
}
else
{
CameraRoll.mkdir
}
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File
(cameraRoll+"/",IMAGE_CAPTURE_NAME))););
startActivityForResult(intent, Camera_PICTURE);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode,resultCode,data);
if (requestCode == Camera_PICTURE) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
}
}