PDA

View Full Version : requestFocus() not working properly



asmitakulkarni
10-11-2011, 03:11 AM
I have got two edittext fields accno & amount. When accno is entered & when we leave the field I have put a validation in onFocusChanged() & if the data is not valid I want to display a message & again shift the focus to accno field instead of amount . For that I have used accNo.requestFocus(). But it is not working properly.
i.e. the accNo field is not being focussed . Only a cursor is shown on that. But we cannot enter any value in accno. If any value is entered it goes in amount field.

alostpacket
12-10-2011, 03:33 PM
I've had issues with this as well -- I dont think requestFocus works correctly. You could also try requestFocusInTouchMode I think it's called.

Another possible work-around would be to make the amount field disabled/hidden until the account field is verified... Not the best solution but maybe it helps :)