Getting nullpointer exception on capturing image from camera, android?

view story

http://stackoverflow.com – I tested my code on sony, samsung and HTC devices where it works fine. But it doesnt work on other devices like karbonn etc... Here is my code Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file // start the image capture Intent startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE); This is the onactivity result code @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { (HowTos)