A simple class that manages the list of recent files.
You can set the maximum number of recent files. The default is 5.
Depends on: B4XCollections and JavaObject.
Usage instructions:
1. Call xui.SetDataFolder to set the default files folder:
B4X:
xui.SetDataFolder("FormsBuilder")
B4X:
RecentManager.Initialize(Me, "Recent", MenuBar1.Menus.Get(0))
The manager will add and remove the recent files menu items as needed.
3. Whenever you want to add a file to the recent files list:
B4X:
RecentManager.AddFile(f)
4. Save the list of files when the program ends:
B4X:
Sub MainForm_Closed
RecentManager.SaveList
End Sub
Updates
v1.01 - Files are checked for existence when the list is loaded.
Top item is the most recently used file.
Attachments
Last edited: