Android Question strange behavior of file dialog

shb777

Active Member
Licensed User
Longtime User
This is the code that is behaving strangely.

B4X:
Sub Activity_Create(FirstTime As Boolean)
   
   
    If FirstTime Then
        player1.Initialize("player")
       
        sources.Initialize
        Bmp.Initialize(File.DirAssets, "android48.png")
       
       
       
        CurrentDir=File.DirRootExternal
        CurrentDir="/storage/6636-6366/videos"
       
    End If

later this code runs


B4X:
  Dim fd As FileDialog
 
    fd.FastScroll = True
    fd.ShowOnlyFolders = False
    fd.FilePath = CurrentDir
    ret = fd.Show("B4A File Dialog", "Yes", "No", "Maybe", Bmp)
 
    CurrentDir=fd.FilePath
    VideoName=fd.ChosenName


notice in activity create, I assign CurrentDir a value twice in consecutive lines. So the first assignment
shouldn't matter. But it does. If I comment out CurrentDir=File.DirRootExternal, the file dialog
doesn't work. It go around in circles, and never let's me chose a file. But if it's in, the file dialog works correctly. Very strange!
 

DonManfred

Expert
Licensed User
Longtime User
Best way to get help would be if you upload a small example project which shoes the issue!

What did you set the FileFilter to?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
"CurrentDir="/storage/6636-6366/videos"

Can it be that this for doesn't exist and therefore the dialog fails to find it?
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
"CurrentDir="/storage/6636-6366/videos"

Can it be that this for doesn't exist and therefore the dialog fails to find it?
it does exist because if I set CurrentDir to File.DirRootExternal before "/storage/6636-6366/videos" it plays the files in that folder
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I've tried to upload it, but the forum says it's too large. it's 2.8 mb it's a small program already. it's only 155 lines.
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
here it is with the export. I didn't know about that. you need to create a dir with the same name as mine, with video files in it, on the sdcard, for it to work I'm going to bed now so I'll check this thread tomorrow
 

Attachments

  • exoplayer.zip
    8.8 KB · Views: 151
Upvote 0
Top