onActivityResult 未使用摄像头调用 activity
onActivityResult is not calling using camera activity
Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(captureIntent, CAMERA_REQUEST);
拍照后无法调用onActivityResult
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK)
{
photo = (Bitmap) data.getExtras().get("data");
//CALL THIS METHOD TO GET THE URI FROM THE BITMAP
Uri tempUri = getImageUri(getContext(), photo);
}
}
我是用这条线修复的
android:configChanges="orientation|screenSize"
进入具有相关 activity.
的 AndroidManifest 文件
Intent captureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(captureIntent, CAMERA_REQUEST);
拍照后无法调用onActivityResult
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK)
{
photo = (Bitmap) data.getExtras().get("data");
//CALL THIS METHOD TO GET THE URI FROM THE BITMAP
Uri tempUri = getImageUri(getContext(), photo);
}
}
我是用这条线修复的
android:configChanges="orientation|screenSize"
进入具有相关 activity.
的 AndroidManifest 文件