Hi all, I am having some trouble defining how focus should move through my app. I have a Tab Layout which I set up following the android tutorial: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
In my first tab, I have created a custom widget that acts as a sub-tab menu. It is a RelativeLayout with two buttons laid out horizontally. I am handling focus events on my custom widget so that I can determine which of the two buttons should be focused as the user navigates up and down in my app. Underneath the sub-tab menu is a list. I created a custom xml file for my custom widget and the RelativeLayout I defined there is marked focusable and focusableInTouchMode. When I navigate up from the list, my RelativeLayout's focusListener is notified as I would have expected and I can determine which of the two buttons should be focused. This works great! However, when I go back up to the tab layout and then navigate down again, my RelativeLayout doesn't get focus. Instead, focus jumps directly to the 1st button in my custom widget, which is not correct. Does anyone know why this would be happening? I have tried a few things to fix this but nothing seems to work. One thing I tried is configuring the "nextFocusDownId" on my 1st tab by calling: tabHost.getTabWidget().getChildAt(0).setNextFocusDownId(R.id.collect_subtab_view); When I do this, I notice in DDMS that there is a log statement saying "couldn't find next focus view specified by user for id 2131230742". Is this because the collect_subtab_view id is defined in a different xml file than my tabhost? How can I correctly set the nextFocusDownId? Thanks, Manisha -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

