Android Question Navigation and field focus

DataMiser

Member
Licensed User
A couple quick questions.
1: I have noticed that on the emulator I see a different result than on my tablet and phone under a given case. Say there are 4 fields two that are side by side and two more below them.
Field1 Field2
Field3 Field4
On the tablet and the phone when the next key is pressed focus goes from Field1 >2 >3 >4
On the emulator [Nexus S] arm version It goes Field1 >3 >done

So any way to predict or handle this to get the navigation order desired?

2: Another case where I have two fields side by side and have them set to receive a measurement in Feet and Inches. Default navigation is fine as above on the tablet and phone and has issue with emulator.

In this case though I have some code that is intended to over ride the default navigation and move the cursor under certain cases but is not working as expected when tested on the tablet or phone.

B4X:
If IsNumber(EditText1.Text) Then
   Dim Wn As Int
   Wn=Floor(EditText1.Text)
   If Wn<EditText1.Text Then
     EditText2.Text=NumberFormat2((EditText1.Text-Wn)*12,1,3,0,False)
     EditText1.Text=Wn
     EditText3.RequestFocus
   End If
End If

The intention here is that if the user enters a decimal value in field 1 it is translated into two fields then skips over field 2.

In operation it is sending the cursor to the second field when I want it to go to the third.

Any idea what I need to do to get the desired behavior in these cases?
 

DataMiser

Member
Licensed User
Ok I managed to get the navigation in the second case handled by adding code to the focuschanged event using a flag to skip over the field.

Still not sure how to handle the first case above. Is not a problem so long as it is just the emulator doing this but if an actual device does this could be an issue.
 
Upvote 0
Top