在我的應用程序按鈕點擊後,我想顯示在我的應用程序中選擇可用的照片應用程序。我們的目標是從其中一個與照片相關的應用中選擇圖片,並將其顯示在我的應用中。意圖打開保管箱在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