I found two topics (
1
,
2
) about the choice of several files but didnt found the answer. Can I choose several files using ContentChooser?
Here
was written about EXTRA_ALLOW_MULTIPLE. Can I add this function to ContentChooser? I need to add 10-15 photos at a time in my app, and it is very long to add them one at a time.
As you can see in that thread it didn't work with most file explorers.
You cannot add this flag to ContentChooser.
Thank you, this is a very good library, but still not what I wanted. Are there any other similar libraries?
Is it possible to choose several photos using ContentChooser?
You can send whichever intent you like.
StartActivityForResult:
https://www.b4x.com/android/forum/threads/40374/#content
ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT"
EXTRA_ALLOW_MULTIPLE = "android.intent.extra.ALLOW_MULTIPLE"
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private ion As Object
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
ShowPicker
End Sub
Sub ShowPicker
Dim i As Intent
i.Initialize("android.intent.action.GET_CONTENT", "")
StartActivityForResult(i)
End Sub
Sub ion_Event (MethodName As String, Args() As Object) As Object
If Args(0) = -1 Then 'resultCode = RESULT_OK
Dim i As Intent = Args(1)
Dim jo As JavaObject = i
Dim uri As String = jo.RunMethod("getParcelableExtra",Array As Object("android.intent.extra.ringtone.PICKED_URI"))
Log(uri)
End If
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…