i want’s to display image capture using device camera and for that i have used below code.but i am getting null value in data that is return in onActivityResult .so please provide me solution for that..
thanks,
and my code is:
File root = new File(Environment.getExternalStorageDirectory()+"/TestCameraGallery");
root.mkdirs();
MyCameraGallery = new File(root, "mycamerapicname");
Uri outputFileUri = Uri.fromFile(MyCameraGallery );
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, CAMERA_PIC_REQUEST);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == CAMERA_PIC_REQUEST)
{
Uri uri = data.getData();
}
}
value of uri is null and give null pointer exception so please help me
Using your code you will get low resolution image. If you wanna get the high resolution image you can refer this answer.
And also you can refer this blog