In my two to three application I have to used camera activity from application. User taken the picture using camera and set that image on image View.
It works for all devices excepting Droid X. When the user takes the picture from Droid X mobile, application is forced close.
Here is my code for start camera activity:
public void startCameraActivity()
{
_path = Environment.getExternalStorageDirectory() + "/default.jpg";
File file = new File( _path );
Uri outputFileUri = Uri.fromFile( file );
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_PIC_REQUEST) {
_taken = true;
bita = BitmapFactory.decodeFile( _path);
imv.setImageBitmap(bita);
}
}
So what should I do to run camera activity successfully in Droid X? I wasn't able to find what the problem is.