I use the following code to take a picture from the camera and get the path to the image.
...
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_IMAGE_CAPTURE);
...
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult:" + resultCode + " request:" + requestCode);
switch (requestCode) {
case CAMERA_IMAGE_CAPTURE:
Uri selectedImageUri = data.getData();
userImagePath = getPath(selectedImageUri);
break;
}
}
It works great on emulator and on different devices. But on the Samsung Galaxy Nexus (4.0.2) it does not launch the camera app. But it returns RESULT_OK in onActivityResult, and I see no exceptions in LogCat. Please give me advice on how to solve this problem. Thanks in advance!
source
share