Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim Button1 As Button Dim bmp As Bitmap End Sub
Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: 'Activity.LoadLayout("Layout1") Activity.LoadLayout("Main") bmp.InitializeSample(File.DirAssets, "bermoy.jpg",48,48) Activity.Title = "File Dialog - Lyndon Bermoy" End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosedAs Boolean) End Sub Sub Button1_Click Dim fd As FileDialog Dim ret As Object fd.FastScroll = True fd.KeyboardPopUp = False 'fd.ShowOnlyFolders = True fd.FilePath = File.DirRootExternal ' also sets ChosenName to an emtpy string 'fd.ShowOnlyFolders = true 'fd.FileFilter = ".txt" ' for example or ".jpg,.png" for multiple file types ret = fd.Show("B4A File Dialog", "Yes", "No", "Maybe", bmp) ToastMessageShow(ret & " : Path : " &fd.FilePath& CRLF & "File : " &fd.ChosenName, False) End Sub