I am using the "Save File" code from Erel's sample
https://www.b4x.com/android/forum/t...list-of-other-related-methods.129897/#content
It goes well if I use it in a small test program (with B4XPages) -> B4A program opens a "system" window and requests user's agreement for writing the file in Download directory.
If I move this code in a large program with several pages, the "ion-Event" is never fired after the opening and the agreement for writing the file
Launching code (placed in B4XMainPage) is as follows :
https://www.b4x.com/android/forum/t...list-of-other-related-methods.129897/#content
It goes well if I use it in a small test program (with B4XPages) -> B4A program opens a "system" window and requests user's agreement for writing the file in Download directory.
If I move this code in a large program with several pages, the "ion-Event" is never fired after the opening and the agreement for writing the file
Launching code (placed in B4XMainPage) is as follows :
With :Dim intent As Intent
intent.Initialize("android.intent.action.CREATE_DOCUMENT", "")
intent.AddCategory("android.intent.category.OPENABLE")
intent.PutExtra("android.intent.extra.TITLE", Title)
intent.SetType(MimeType)
StartActivityForResult(intent)
Wait For ion_Event (MethodName As String, Args() As Object)
Any idea what is happening ?Private Sub StartActivityForResult(i As Intent)
Dim jo As JavaObject = GetBA
ion = jo.CreateEvent("anywheresoftware.b4a.IOnActivityResult", "ion", Null)
jo.RunMethod("startActivityForResult", Array(ion, i))
End Sub
Sub GetBA As Object
Dim jo As JavaObject = Me
Return jo.RunMethod("getBA", Null)
End Sub