package com.example.administrator.mytestapp.TabHost;import android.app.TabActivity;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.view.LayoutInflater;import android.widget.TabHost;import com.example.administrator.mytestapp.R;public class TabHostDemo extends TabActivity {private TabHost bookth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.activity_tab_host_demo); bookth=getTabHost(); LayoutInflater.from(this).inflate(R.layout.activity_tab_host_demo,bookth.getTabContentView(),true); bookth.addTab(bookth.newTabSpec("done").setIndicator("已读").setContent(R.id.doneBook)); bookth.addTab(bookth.newTabSpec("doing").setIndicator("正读").setContent(R.id.doingBook)); bookth.addTab(bookth.newTabSpec("will").setIndicator("未读").setContent(R.id.willBook)); }}