Hi Erel,
Just playing around with Basic4Android whilst waiting for my first Android phone.:sign0098:
Is there a list of events for the various view that can be used.
As an example, I have an EditText and would like the existing text to be selected when a user enters the EditText. So, is there the equivalent of EditText.OnEnter where I could SelectAll?
I don't remember where I found the demo that allowed me to program the select all on getting focus of my edittext views. It was attached to the fine Reflection Library. Below is the code I used, and it worked great. Only one reflection object was needed for all four of my edittext views.
Sub Globals
'These global variables will be redeclared each time the activity is created.
Dim edtFat As EditText
Dim edtCarbs As EditText
Dim edtProtein As EditText
Dim edtFiber As EditText
Dim Obj1 As Reflector
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout1") 'Load the layout file.
Obj1.Target = edtFat
edtFat.Tag = "edtFat"
Obj1.SetOnFocusListener("OnFocus")
Obj1.Target = edtCarbs
edtCarbs.Tag = "edtCarbs"
Obj1.SetOnFocusListener("OnFocus")
Obj1.Target = edtProtein
edtProtein.Tag = "edtProtein"
Obj1.SetOnFocusListener("OnFocus")
Obj1.Target = edtFiber
edtFiber.Tag = "edtFiber"
Obj1.SetOnFocusListener("OnFocus")
edtFat.RequestFocus
End Sub
Sub OnFocus(viewtag As Object, focus As Boolean)
If viewtag = "edtFat" Then edtFat.SelectAll
If viewtag = "edtCarbs" Then edtCarbs.SelectAll
If viewtag = "edtProtein" Then edtProtein.SelectAll
If viewtag = "edtFiber" Then edtFiber.SelectAll
End Sub