0

How do i put a long Scrollview inside a tab? This is my code: Resources ressources = getResources(); TabHost tabHost = getTabHost();

            // Android tab
            Intent intentAndroid = new Intent().setClass(this, ScrollActivity1.class);
            TabSpec tabSpecAndroid = tabHost
                .newTabSpec("Android")
                .setIndicator("", ressources.getDrawable(R.drawable.tab_checkin))
                .setContent(intentAndroid);

            // Apple tab
            Intent intentApple = new Intent().setClass(this, ScrollActivity2.class);
            TabSpec tabSpecApple = tabHost
                .newTabSpec("Apple")
                .setIndicator("", ressources.getDrawable(R.drawable.tab_contatti))
                .setContent(intentApple);
Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
LuZa
  • 450
  • 1
  • 6
  • 27

1 Answers1

1

The activity runs inside the host tab in a FrameLayout, so, whatever UI you put in the setContextView for your ScrollActivity1 and ScrollActivity2, you'll get it as content of the tab.

You need to put ScrollView as the top level layout element in the layout xml of your activities.

SurenNihalani
  • 1,398
  • 2
  • 15
  • 28