-1

I have a concept of file uploading in my application. When I clicks the button file upload then it is showing all the folders available in my device like File Explorer, Gallery etc. It is also showing the Google Drive folder. But I don't want to make it visible.

I don't know how to do that?

Please someone can help me.

This is my code.

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
            intent.setType("*/*");
            startActivityForResult(Intent.createChooser(intent,
                    "Select a file to upload"), FILE_SELECT_CODE);

1 Answers1

-1

Maybe what you want to use is Intent.ACTION_PICK instead of Intent.ACTION_GET_CONTENT.

Check this link. There you will find the difference between the two of them. Basically, that you should use Intent.ACTION_PICK when you want to select files from a particular location and Intent.ACTION_GET_CONTENT when you do not care about the location but want a specific kind of data.

Community
  • 1
  • 1
AlvaroSantisteban
  • 5,256
  • 4
  • 41
  • 62