I use following code take a Picture from camera and to obtain picture's path.
...
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_IMAGE_CAPTURE); // 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 good on emulator and on different devices. But on Samsung Galaxy Nexus(4.0.2) it does not launches Camera app. But it returns RESULT_OK to onActivityResult and I see no exceptions in LogCat.
Please give me and advice how to solve this issue.
Thanks in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…