Resultcode and data null in onActivityresult

I have a code in which I set the image taken from the camera to a vector, and then use the image adapter to display the captured image. But I get the result code as 0, and the data as null in OnActivityResut. Below is the camera start code, and it works, i.e. i click image using camera

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, CAMERA_REQUEST); 

then I use OnActivityResult as shown below

 protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK) { ImageView photo = (ImageView) data.getExtras().get("data"); m_oVectorOfImages.add(photo); m_oImageAdapter.notifyDataSetChanged(); } } 

Can I find out why resultcode matches 0 and data as null?

+4
source share

All Articles