Android Question StartActivityForResult, get file name and path

Mostez

Well-Known Member
Licensed User
Longtime User
I've data-table and I want to export it to excel, no problem with this, I just want to open 'Save' dialog and get file name and path. I've seen this example, how to modify it to just get file name and path to use it later with my export sub?
I used this code but I always get an empty array!

B4X:
Dim intent As Intent
intent.Initialize("android.intent.action.CREATE_DOCUMENT", "")
'intent.AddCategory("android.intent.category.OPENABLE")
intent.PutExtra("android.intent.extra.TITLE", "New.xls")
intent.SetType("application/vnd.ms-excel")
StartActivityForResult(intent)
Wait For ion_Event (MethodName As String, Args() As Object)
    If -1 = Args(0) Then 'resultCode = RESULT_OK
        Dim result As Intent = Args(1)
        Dim jo As JavaObject = result       
        Dim fn() As Object = Array(jo.RunMethod("getData", Null)) ' always empty
 
Top