5

I have a code where i set the image captured from camera to an vector and then use image adapter to show the captured image.but im getting result code as 0 and data as null in OnActivityResut.Below is the code to launch a camera 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 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 know why resultcode is coming 0 and data as null?

user1340801
  • 423
  • 3
  • 10
  • 21
  • Try out only as `if (requestCode == CAMERA_REQUEST) { Bitmap photo = (Bitmap) data.getExtras().get("data"); }` – GrIsHu Mar 06 '13 at 09:46
  • @ Grishu :even if i use your answer im getting the data as null and resultcode as 0 .my question is why data should be null?? its shd be the image i catured right\ – user1340801 Mar 06 '13 at 09:55

0 Answers0