I am developing an application which among other things makes pictures. To take the picture I use:
Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(camera, 1);
My onActivityResult:
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Image_Selecting_Task(data);
if (requestCode == 1) {
Image_Selecting_Task(data);
} else if (requestCode == 2) {
Image_Selecting_Task(data);
}
}
public void Image_Selecting_Task(Intent data) {
try {
if (data.getData() != null) {
....
} else {
}
}
}
In Galaxy s2, s3, tab3, works perfect, but Galaxy S5 I can not get the data. However if I select an image from the gallery this works.
Please try my code: