Android Question Multiple photo selection does not work on all devices

red30

Well-Known Member
Licensed User
Longtime User
I use this code to select multiple photos from gallery:
B4X:
Sub Activity_Click
   Dim i As Intent
   i.Initialize("android.intent.action.GET_CONTENT", "")
   i.PutExtra("android.intent.extra.ALLOW_MULTIPLE", True)
   i.SetType("image/*")
   StartActivityForResult(i)
End Sub

Sub ion_Event (MethodName As String, Args() As Object) As Object
'Args(0) = resultCode
'Args(1) = intent
   Return Null
End Sub

Sub StartActivityForResult(i As Intent)
  Dim jo As JavaObject = GetBA
  ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null)
  jo.RunMethod("startActivityForResult", Array As Object(ion, i))
End Sub

Sub GetBA As Object
  Dim jo As JavaObject
  Dim cls As String = Me
  cls = cls.SubString("class ".Length)
  jo.InitializeStatic(cls)
  Return jo.GetField("processBA")
End Sub
I noticed that not all devices can select several photos at once. On some you have to "hold your finger" to select multiple photos. But on some it is not possible at all. For example, my tablet is a samsung galaxy 4. Android 5.0.2. It is generally impossible to select several photos on it. Also the Samsung A50 phone. If “recent” is selected, it is possible to select several photos, but if you select a gallery, camera, then it is impossible to select several photos. Also on xiaomi mi 9t. If you select recent or gallery, then everything works fine, but if you select explorer, then multiple photo selection does not work.
Why is this happening? How can you make multiple photo selections work on all devices?
I am especially interested in the question with the Samsung, why can't you select a lot of photos on them in the standard gallery?
 
Top