Hello,

I am having a problem with tabbed activity using D-Pad for navigation.
The problem is, when focused on tab content (for example of the first
tab), when you click on the 'up' key, *focus goes to a wrong tab*
(third for me).

I used emulator for testing. The problem appears only if
android:minSdkVersion in AndroidManifest.xml appears to be greater
than 3.

To reproduce this problem you can create an Android project with this
activity and specify android:minSdkVersion to be anything greater than
three.

I suppose the problem is due to new focusing algorithm in newer
versions of Android SDK. Please feel free to share any thought on how
to solve this.

The problem does not appear if I use .setContent(Intent) method. I
used also Activity with setting up TabHost myself, and it did not
work.

public class A extends TabActivity {
    private TabHost tabHost;
    private TabWidget tabWidget;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        tabHost = getTabHost();

        final Button a = new Button(this), b = new Button(this), c =
new Button(this);

 
tabHost.addTab(tabHost.newTabSpec("a").setIndicator("a").setContent(new
TabContentFactory() {
            public View createTabContent(String arg0) {
                return a;
            }
        }));
 
tabHost.addTab(tabHost.newTabSpec("b").setIndicator("b").setContent(new
TabContentFactory() {
           public View createTabContent(String arg0) {
               return b;
           }
       }));
 
tabHost.addTab(tabHost.newTabSpec("c").setIndicator("c").setContent(new
TabContentFactory() {
           public View createTabContent(String arg0) {
               return c;
           }
       }));
    }
}

-- 
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

Reply via email to