Question

I have a small app where some people can have a 1:1 chat with each other. Now I want to implement a possibility to share some files (images, sounds, whatever,...).

My problem: I need a possibility to let the user choose such a file. Since I did not find some kind of "file dialogue" for Android: what is the best way to do this?

I do not need a ready-to use solution but just some hints/ideas how this could be done out of an app.

Thanks!

Was it helpful?

Solution

You can have one Button in your screen and clicking on that button let user choose a file from gallary using below code,

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);//
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_IMAGE);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top