当前位置: 代码迷 >> Android >> android中tab的运用
  详细解决方案

android中tab的运用

热度:75   发布时间:2016-05-01 20:12:36.0
android中tab的使用

public class TabUiActivity extends TabActivity implements OnTabChangeListener{		private TabHost tabHost;	    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                tabHost = getTabHost();        tabHost.setOnTabChangedListener(this);                        tabHost.addTab(tabHost.newTabSpec("Memo")                .setIndicator(getResources().getString(R.string.fir)                        ,getResources().getDrawable(R.drawable.ic_tab_memo))                .setContent(new Intent(this, FirActivity.class)));                tabHost.addTab(tabHost.newTabSpec("Appointment")                .setIndicator(getResources().getString(R.string.sec)                        ,getResources().getDrawable(R.drawable.ic_tab_appointment))                .setContent(new Intent(this, SecActivity.class)));    }	@Override	public void onTabChanged(String tabId) {		System.out.println("=========" + tabId);	}}
?
  相关解决方案