我有这个code:
startActivityForResult(新意图(MediaStore.ACTION_IMAGE_CAPTURE),CAMERA_IMAGE);
,它允许用户拍摄照片。现在,我怎么会得到 onActivityResult
的的那张照片乌里
?它是一个意图
额外?它是通过 Intent.getData()
?
保护无效onActivityResult(INT申请code,INT结果code,意图意图){
乌里U = intent.getData();
}
顺便说一句...有与意图在某些设备上的错误。看看这个答案要懂得变通办法。
I have this code:
startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), CAMERA_IMAGE);
That allows that user to take a photo. Now how would I get the Uri
of that photo in onActivityResult
? Is it an Intent
extra? Is it through Intent.getData()
?
protected void onActivityResult(int requestCode, int resultCode, Intent intent){
Uri u = intent.getData();
}
By the way... there's a bug with that intent in some devices. Take a look at this answer to know how to workaround it.