Android Question [solved]ContentChooser doesn't get back to ChooserResult

KMatle

Expert
Licensed User
Longtime User
I let the user choose a pic and then "ChooserResult" should be called.

Strage: In debug mode it works all the time, in release it fails (sometimes and sometimes not). No logs seen. Any ideas?

Problem: It doesn't get back to ChooserResult.

Code:
B4X:
Sub choose_pic
    Dim chooser As ContentChooser
    If chooser.IsInitialized = False Then
        chooser.Initialize("chooser")
    End If
    chooser.show("image/*", "Choose image")
End Sub
Sub chooser_Result(Success As Boolean, Dir As String, FileName As String)
    PicID=""
    Msgbox("Picture Selected","")
    If Success Then ...


Got that code part from an example. Now I've put the DIM of the chooser in Process Globals and the initialize in Activity_Create and it works ...
 
Last edited:

DavideV

Active Member
Licensed User
Longtime User
I let the user choose a pic and then "ChooserResult" should be called.

Strage: In debug mode it works all the time, in release it fails (sometimes and sometimes not). No logs seen. Any ideas?

Problem: It doesn't get back to ChooserResult.

Code:
B4X:
Sub choose_pic
    Dim chooser As ContentChooser
    If chooser.IsInitialized = False Then
        chooser.Initialize("chooser")
    End If
    chooser.show("image/*", "Choose image")
End Sub
Sub chooser_Result(Success As Boolean, Dir As String, FileName As String)
    PicID=""
    Msgbox("Picture Selected","")
    If Success Then ...


Got that code part from an example. Now I've put the DIM of the chooser in Process Globals and the initialize in Activity_Create and it works ...


Thanks, you saved my time... i've got this problem on my LG G4.
It seem that doesn't happen on all devices.
 
Upvote 0
Top