Storage Access Framework shows One Drive ,Google Drive twice

Is there a reason why I see third party apps twice. Setting the Intent.

Tagged:

Answers

  • BillyLiuBillyLiu Member, Xamarin Team Xamurai

    @RajKulkarni.0951

    Could you post your code?

  • RajKulkarni.0951RajKulkarni.0951 USMember ✭✭

    @BillyLiu This is the equivalent Java code. https://github.com/googlesamples/android-StorageClient
    Appreciate your help!

  • arodriguezarodriguez Member ✭✭

    I have the same issue which has to do with the Intent Action in this method of the StorageClientFragment class in the Android code above:

    public void performFileSearch() {
    
        // BEGIN_INCLUDE (use_open_document_intent)
        // ACTION_OPEN_DOCUMENT is the intent to choose a file via the system's file browser.
        Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    
        // Filter to only show results that can be "opened", such as a file (as opposed to a list
        // of contacts or timezones)
        intent.addCategory(Intent.CATEGORY_OPENABLE);
    
        // Filter to show only images, using the image MIME data type.
        // If one wanted to search for ogg vorbis files, the type would be "audio/ogg".
        // To search for all documents available via installed storage providers, it would be
        // "*/*".
        intent.setType("image/*");
    
        startActivityForResult(intent, READ_REQUEST_CODE);
        // END_INCLUDE (use_open_document_intent)
    }
    

    When the Intent Action is OPEN_DOCUMENT, only the first two Drive and OneDrive options are displayed, like in @RajKulkarni.0951 's screenshot, but apps like Dropbox don't show. When the Action is GET_CONTENT, I get the Dropbox option, but with the duplicated Drive and OneDrive options as well.

    I'd prefer if all the cloud services showed up when the Action was OPEN_DOCUMENT since it grays out the documents with MIME types that I don't want, but the duplicated options seem to open in their respective apps and allow the user to pick MIME types I don't support.

  • RajKulkarni.0951RajKulkarni.0951 USMember ✭✭

    This is as designed. Even Google App shows the same behavior. Thanks @arodriguez

Sign In or Register to comment.