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);
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.