mohammad javad
Member
Hey
I'm using the same example of dialog.showtemplate in B4A for pressing Button10
I defined "options As B4XListTemplate" in Globals. Then initialize it after my layout has been loaded (which contains Button10) and put the options in options
dlg and base have been defines as B4XDialog and B4XView in Globals and base=Activity.
in Button10 click event I put:
I got three errors (in debugger) . first one happens when I click on Button10 but dialog will be shown and it is
1-java.lang.OutOfMemoryError
and the second and third ones happen when I choose one item (like "Dog" or click on ok or cancel) and they are
2-Error occurred on line: 174 (B4XDialog)
java.lang.RuntimeException: Unexpected command: 0
3-Error occurred on line: 174 (B4XDialog)
java.lang.ClassCastException: java.lang.String cannot be cast to anywheresoftware.b4a.shell.Shell$RemoteObject
does anybody have an idea what I did wrong?
I'm using the same example of dialog.showtemplate in B4A for pressing Button10
I defined "options As B4XListTemplate" in Globals. Then initialize it after my layout has been loaded (which contains Button10) and put the options in options
B4X:
Activity.LoadLayout("Mobile")
options.Initialize
options.Options = Array("Cat", "Dog", "Fish", "Crocodile")
base=Activity
dlg.Initialize(base)
dlg and base have been defines as B4XDialog and B4XView in Globals and base=Activity.
in Button10 click event I put:
B4X:
Sub Button10_Click
Wait For (dlg.ShowTemplate(options, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
dlg.Show($"You selected: ${options.SelectedItem}"$, "OK", "", "")
End If
End Sub
I got three errors (in debugger) . first one happens when I click on Button10 but dialog will be shown and it is
1-java.lang.OutOfMemoryError
and the second and third ones happen when I choose one item (like "Dog" or click on ok or cancel) and they are
2-Error occurred on line: 174 (B4XDialog)
java.lang.RuntimeException: Unexpected command: 0
3-Error occurred on line: 174 (B4XDialog)
java.lang.ClassCastException: java.lang.String cannot be cast to anywheresoftware.b4a.shell.Shell$RemoteObject
does anybody have an idea what I did wrong?