Thanks for saving Johan, this really big help. I used this sub and then it showing now instantly the files that are exported in the window explorer.
Sub ForceGallery (Dir As String, FileName As String)
Dim Phone As Phone
If Phone.SdkVersion<19 Then
Dim i As Intent
i.Initialize("android.intent.action.MEDIA_MOUNTED", "file://" & File.Combine(Dir, FileName))
Phone.SendBroadcastIntent(i)
Else
Dim context As JavaObject
context = context.InitializeStatic("anywheresoftware.b4a.BA").GetField("applicationContext")
Dim paths() As String = Array As String(File.Combine(Dir,FileName)) 'files to scan
Dim mediaScanner As JavaObject
mediaScanner.InitializeStatic("android.media.MediaScannerConnection")
mediaScanner.RunMethod("scanFile", Array As Object(context, paths, Null, Null))
End If
End Sub