Как удалить второй заголовок панели?
Если я реализую этот код. так покажи две строки заголовка. Один верхний до вкладок, а другой заголовок вниз до вкладок.
его работа в порядке, нажмите на вкладку один, перейдя в Tab1Activity нажмите на вкладку два, перейдите в Tab2Activity нажмите на вкладку три, перейдя в Tab3Activity
но только удалить вторую строку заголовка.
public class MainActivity extends AppCompatActivity
{
LocalActivityManager mlam;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mlam = new LocalActivityManager(this, false);
mlam.dispatchCreate(savedInstanceState);
// create the TabHost that will contain the Tabs
TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
tabHost.setup(mlam);
TabHost.TabSpec tab1 = tabHost.newTabSpec("First Tab");
TabHost.TabSpec tab2 = tabHost.newTabSpec("Second Tab");
TabHost.TabSpec tab3 = tabHost.newTabSpec("Third tab");
// Set the Tab name and Activity
// that will be opened when particular Tab will be selected
tab1.setIndicator("Tab one");
tab1.setContent(new Intent(this,Tab1Activity.class));
tab2.setIndicator("Tab two");
tab2.setContent(new Intent(this,Tab2Activity.class));
tab3.setIndicator("Tab three");
tab3.setContent(new Intent(this,Tab3Activity.class));
tabHost.addTab(tab1);
tabHost.addTab(tab2);
tabHost.addTab(tab3);
}
}
XML FILE
<TabHost
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabhost">
<LinearLayout
android:id="@+id/LinearLayout01"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
</FrameLayout>
</LinearLayout>
</TabHost>
RelativeLayout>