Sub SetFocus(obj As Object, hasfocus As Boolean, updatedouble As Boolean, myIME As IME)
If obj Is EditText Then
Dim et As EditText
et = obj
If hasfocus Then
et.SelectAll
myIME.ShowKeyboard(et)
Else
If updatedouble Then et.Text = FixDouble(et.Text)
myIME.HideKeyboard
End If
Else If obj Is AutoCompleteEditText Then
Dim ace As AutoCompleteEditText
ace = obj
If hasfocus Then
ace.SelectAll
myIME.ShowKeyboard(ace)
Else
myIME.HideKeyboard
End If
End If
End Sub