even exploring whole stackoverflow and Google as well to get solution but i found nothing relevant to my problem.
Problem is: I take picture from camera it works on few phones and many phones just crash, Google says use this code to take picture but it does not work on all devices either

- Code: Select all
Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File dir=
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
output=new File(dir, "CameraContentDemo.jpeg");
i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(output));
startActivityForResult(i, CONTENT_REQUEST);
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (requestCode == CONTENT_REQUEST) {
if (resultCode == RESULT_OK) {
Uri selectedImage = Uri.fromFile(output);
getContentResolver().notifyChange(selectedImage, null);
ImageView imageView = (ImageView) findViewById(R.id.imageView1);
ContentResolver cr = getContentResolver();
Bitmap bitmap;
try {
bitmap = android.provider.MediaStore.Images.Media
.getBitmap(cr, selectedImage);
imageView.setImageBitmap(bitmap);
Toast.makeText(this, selectedImage.toString(),
Toast.LENGTH_LONG).show();
} catch (Exception e) {
Toast.makeText(this, "Failed to load", Toast.LENGTH_SHORT)
.show();
Log.e("Camera", e.toString());
}
}
}
}
It Works On these Phones:
- Samsung Galaxy S1,S2
Sumsung Ace
Motorola Droid
Droid Razr Maxx HD
It Does Not Work On these Phones:
- Droid Razr Maxx w
Xoom tablet
Please put some light on it, whether my code is incorrect or these phones have some issue?
any help would be appreciated.

