package com.jqyd.manager; import com.jqyd.app.MyApp; import com.jqyd.son.DwKq; import com.jqyd.son.Jpsb; import com.jqyd.son.Kcsb; import com.jqyd.son.TxlList; import com.jqyd.son.Xgmm; import com.jqyd.son.Xssb; import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.view.Window; import android.widget.TabHost; import android.widget.TabHost.TabSpec; public class TabThird extends TabActivity { private MyApp myApp; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); // 无title requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.commontab); myApp = (MyApp) this.getApplication(); TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); String content = "Product Model: " + android.os.Build.MODEL + "," + android.os.Build.VERSION.SDK + "," + android.os.Build.VERSION.RELEASE; System.out.println("系统相关内容:" + content); String currentapiVersion = android.os.Build.VERSION.RELEASE; String code = String.valueOf(currentapiVersion.charAt(0)).toString(); System.out.println("系统版本号:" + code); if (!code.equals("4")) {// 此设置只针对4.0系统以下有效 tabHost.setPadding(0, -25, 0, 0); // 降低标签页的高度 } TabSpec firstTabSpec = tabHost.newTabSpec("tab1"); TabSpec secondTabSpec = tabHost.newTabSpec("tab2"); TabSpec thirdTabSpec = tabHost.newTabSpec("tab3"); if (myApp.getModuleName().equals("txl")) { firstTabSpec.setIndicator("员工").setContent( new Intent(this, TxlList.class).putExtra("sort", "yg")); secondTabSpec.setIndicator("客户").setContent( new Intent(this, TxlList.class).putExtra("sort", "kh")); thirdTabSpec.setIndicator("潜在客户").setContent( new Intent(this, TxlList.class).putExtra("sort", "qzkh")); } else if (myApp.getModuleName().equals("grsz")) { firstTabSpec.setIndicator("定位管理") .setContent( new Intent(this, DwKq.class).putExtra("moduleName", "dwgl")); secondTabSpec.setIndicator("修改密码").setContent( new Intent(this, Xgmm.class)); thirdTabSpec.setIndicator("自动考勤") .setContent( new Intent(this, DwKq.class).putExtra("moduleName", "zdkq")); } else if (myApp.getModuleName().equals("sjcj")) { firstTabSpec.setIndicator("销售上报").setContent( new Intent(this, Xssb.class)); secondTabSpec.setIndicator("竞品上报").setContent( new Intent(this, Jpsb.class)); thirdTabSpec.setIndicator("库存上报").setContent( new Intent(this, Kcsb.class)); } else if (myApp.getModuleName().equals("xszs")) { firstTabSpec.setIndicator("商品").setContent( new Intent(this, Xszs.class).putExtra("sort", "bp")); secondTabSpec.setIndicator("赠品").setContent( new Intent(this, Xszs.class).putExtra("sort", "zp")); thirdTabSpec.setIndicator("消耗品").setContent( new Intent(this, Xszs.class).putExtra("sort", "xhp")); } tabHost.addTab(firstTabSpec); tabHost.addTab(secondTabSpec); tabHost.addTab(thirdTabSpec); } }