Hi all, I want to set default focus in the first focusable view when entering a new screen, and i use view.requestFocus(View.FOCUS_DOWN) (view is the root ViewGroup), but it doesn't work. The method alway return false. And i also found a strange situation: view.getFocusables (View.FOCUS_DOWN) will return several focusabel views, but view.focusSearch(View.FOCUS_DOWN) returns null. Then i try followed: ArrayList<View> al = view.getFocusables(View.FOCUS_DOWN); if(al != null && al.size() > 0) { al.get(0).requestFocus(); }
It solves the problem, now can focus to the first focusable child view. However it looks strange, and not smart. Do any one have any other smart methods? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---