I want to open the phone's gallery using a button from my application. I'm using something like this:
goToGalleryButton.setOnClickListener {
val intent = Intent()
intent.action = Intent.ACTION_VIEW
intent.type = "image/*"
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
startActivity(intent)
}
After pressing the button, a pop-up for choosing the desired application appears. If I choose the Google Photos application everything is good and I can see all the images and videos as I want, but if I choose the Samsung's gallery I get a toast with "Unsupported file" error message.
Something similar happens on Huawei devices on choosing the native gallery application.
Is there a way to avoid that error message when opening the native gallery app?