Android GridView Focus Issueon children? -


i have gridview custom adapter set. getview() method of custom adapter returns linearlayout 2 textview , edittext arranged horizontally. have made custom numeric keyboard entering text in edittext. keyboard contains next , prev buttons creating problems. want next button automatically focus next edittext in next row , prev button. next button onkeypress seems like:

view v=getwindow().getcurrentfocus().focussearch(view.focus_forward); if(v!=null) v.requestfocus(); 

the code seems right. problem is, suppose 3 rows visible of gridview,if focus on third edittext , next pressed,it focuses on nothing. dont know how solve issue. if knows how solve it.

thanx in advance.

can maintain collection of ids of edittext's in same order, while adding them rendering.

in case, clickhandler or next/prev button, u can check following:

  1. clickhandler of prev: if present selection first in list, might want set focus on last element in list.
  2. clickhandler of next: if present selection last in list, might want set focus on first element in list.

alternatively, if not want list roll functionality, can check position of element in list, , handle brink elements way u want them be.

hope understood problem correctly.

hth


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -