在我的应用程序按钮点击后,我想显示在我的应用程序中选择可用的照片应用程序。我们的目标是从其中一个与照片相关的应用中选择图片,并将其显示在我的应用中。意图打开保管箱在Android中选择图像
按钮点击下面的方法后,正在执行:
private void fireIntentToOpenDeviceImageResources() {
Intent getIntent = new Intent(Intent.ACTION_GET_CONTENT);
getIntent.setType("image/*");
Intent pickIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
pickIntent.setType("image/*");
Intent takePicture = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.TITLE, "New Picture");
values.put(MediaStore.Images.Media.DESCRIPTION, "From your Camera");
imageUri = getContext().getContentResolver().insert(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
takePicture.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
Intent chooserIntent = Intent.createChooser(getIntent, "Select Image");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] {pickIntent, takePicture});
startActivityForResult(chooserIntent, GlobalConsts.PICK_IMAGE_REQUEST);
}
的问题是,我没有看到Dropbox的应用程序(这是肯定的安装在我的测试手机)中创建选择器。我应该添加什么样的意图,以包括Dropbox应用程序?
编辑:
我说这样的意图:
PackageManager manager = getActivity().getPackageManager();
Intent i = manager.getLaunchIntentForPackage("com.dropbox.android");
i.setAction(Intent.ACTION_GET_CONTENT);
getIntent.setType("image/*");
现在它显示在选配的Dropbox应用程序,但我不能从中挑选图像。它只是启动Dropbox应用程序而无需选择并返回到我的应用程序的可能性。
http://stackoverflow.com/questions/18870169/pick-image-from-gallery-camera-dropbox-etc – Pavan