Do I create the prefereancedialog in the Main activity or in B4XMainPage?
Then if in B4XMainPage when initializing what do I put for activity?
In B4J I have created it in B4XMainPage then to initialize I do this which all works well
prefdialog.Initialize(Main.MainForm.RootPane,"Preferences",400dip,400dip)
But I can't figure out how to do it in B4A with B4XPages
Do I create the prefereancedialog in the Main activity or in B4XMainPage?
Then if in B4XMainPage when initializing what do I put for activity?
In B4J I have created it in B4XMainPage then to initialize I do this which all works well
prefdialog.Initialize(Main.MainForm.RootPane,"Preferences",400dip,400dip)
But I can't figure out how to do it in B4A with B4XPages
You're not supposed to use "Main.MainForm.RootPane" in B4XPages. You instead use "Root", with a PreferencesDialog variable declared in each page that needs a Preference Dialog. So for example:
B4X:
'Class_Globals:
Sub Class_Globals
Private PrefDialog As PreferencesDialog
End Sub
'Later:
Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("YourLayoutFile")
PrefDialog.Initialize(Root,"Preferences",400dip,400dip)
End Sub
You're not supposed to use "Main.MainForm.RootPane" in B4XPages. You instead use "Root", with a PreferencesDialog variable declared in each page that needs a Preference Dialog. So for example:
B4X:
'Class_Globals:
Sub Class_Globals
Private PrefDialog As PreferencesDialog
End Sub
'Later:
Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("YourLayoutFile")
PrefDialog.Initialize(Root,"Preferences",400dip,400dip)
End Sub