Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private edt1 As EditText
Private edt2 As EditText
Private edt3 As EditText
Private edt4 As EditText
Private edt5 As EditText
Private edt6 As EditText
Private edt7 As EditText
Private edt8 As EditText
Private edtArray() As EditText 'Prepare an Array to hold all the EditTexts
Private count As Int = 0 'Variable to always move to next EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
edtArray = Array As EditText (edt1, edt2, edt3, edt4, edt5, edt6, edt7, edt8) 'Filling the Array with the Editexts that you want
End Sub
Sub Button1_Click
ChangeFocus 'Call the Sub to move focus
End Sub
Private Sub ChangeFocus
Dim NextEdt As EditText = edtArray(count Mod edtArray.Length) 'Make a reference EditText and assign the next Edittext from the Array that will receive the focus
NextEdt.RequestFocus 'Request Focus
count = count + 1 'Increase to have the next Edittext when calling the sub again
End Sub