【发布时间】:2015-06-28 08:26:11
【问题描述】:
我正在尝试从任何来源(如保管箱、画廊、相机、retrica 等)获取图像,获取他的路径并将其设置在 ImageView 上。通过使用这个意图
private void cameraIntent() {
Intent pickIntent = new Intent();
pickIntent.setType("image/*");
pickIntent.setAction(Intent.ACTION_GET_CONTENT);
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String pickTitle = "Select or take a new Picture";
Intent chooserIntent = Intent.createChooser(pickIntent, pickTitle);
chooserIntent.putExtra
(
Intent.EXTRA_INITIAL_INTENTS,
new Intent[]{takePhotoIntent}
);
startActivityForResult(chooserIntent, REQUEST_CAMERA);
}
但现在,我只能处理 Gallery 和 Camera Intent,如何处理其他应用程序?
【问题讨论】:
标签: android android-intent camera gallery handle