-2
Intent.getData()
返回在Android API 23上的null
並且對於以前的版本正常工作?Intent.getData()在Android API上返回null 23
private void takePicture() {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(intent, 0);
}
...
private void choosePicture()
{
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, 1);
}
...
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
...
Uri selectedImage = data.getData();
String imagePath = getPath(selectedImage);
dest = new File(imagePath);
decodeFile(imagePath);
...
}
它可以有什麼關係運行的權限6.0? – Vucko
確實是授予的權限:'Manifest.permission.READ_EXTERNAL_STORAGE'' Manifest.permission.CAMERA' – Abdellah
@Vucko正在寫外部存儲失蹤:/? – Abdellah