请问华为8.0调用系统相机失败,怎么办呀?
携带参数就闪退,打不开系统相机。
File dir = getCacheDir(); File file = new File(dir, "IMG" + System.currentTimeMillis() + ".jpg"); fileUri = Uri.fromFile(file); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); startActivityForResult(intent, 0);
不携带参数时可正常启动相机
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivity(intent);