Java Code Examples for android.widget.TabHost#newTabSpec()

The following examples show how to use android.widget.TabHost#newTabSpec() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MessageListsActivity.java    From medic-gateway with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override protected void onCreate(Bundle savedInstanceState) {
	log("Starting...");
	super.onCreate(savedInstanceState);

	includeVersionNameInActivityTitle(this);

	TabHost tabHost = getTabHost();

	String[] tabs = getResources().getStringArray(R.array.message_lists_tabs);
	for(int i=0; i<tabs.length; ++i) {
		TabHost.TabSpec spec = tabHost.newTabSpec(tabs[i]);
		spec.setIndicator(tabs[i]);
		spec.setContent(new Intent(this, TAB_CLASSES[i]));
		tabHost.addTab(spec);
	}

	updateForPollStatus();

	LastPoll.register(this, pollUpdateReceiver);
}
 
Example 2
Source File: LauncherActivity.java    From android-apps with MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_launcher);
	
	TabHost tabHost = getTabHost();
	
	TabSpec tab1 = tabHost.newTabSpec("First Tab");
	TabSpec tab2 = tabHost.newTabSpec("Second Tab");
	TabSpec tab3 = tabHost.newTabSpec("Third Tab");
	
	tab1.setIndicator("Tab1",getResources().getDrawable(R.drawable.ic_launcher));
	tab1.setContent(new Intent(this, Tab1Activity.class));
	
	tab2.setIndicator("Tab2",getResources().getDrawable(R.drawable.ic_launcher));
	tab2.setContent(new Intent(this, Tab2Activity.class));
	
	tab3.setIndicator("Tab3",getResources().getDrawable(R.drawable.ic_launcher));
	tab3.setContent(new Intent(this, Tab3Activity.class));
	
	tabHost.addTab(tab1);
	tabHost.addTab(tab2);
	tabHost.addTab(tab3);
	
}
 
Example 3
Source File: LauncherActivity.java    From android-apps with MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_launcher);
	
	TabHost tabHost = getTabHost();
	
	TabSpec tab1 = tabHost.newTabSpec("First Tab");
	TabSpec tab2 = tabHost.newTabSpec("Second Tab");
	TabSpec tab3 = tabHost.newTabSpec("Third Tab");
	
	tab1.setIndicator("Tab1",getResources().getDrawable(R.drawable.ic_launcher));
	tab1.setContent(new Intent(this, Tab1Activity.class));
	
	tab2.setIndicator("Tab2",getResources().getDrawable(R.drawable.ic_launcher));
	tab2.setContent(new Intent(this, Tab2Activity.class));
	
	tab3.setIndicator("Tab3",getResources().getDrawable(R.drawable.ic_launcher));
	tab3.setContent(new Intent(this, Tab3Activity.class));
	
	tabHost.addTab(tab1);
	tabHost.addTab(tab2);
	tabHost.addTab(tab3);
	
}
 
Example 4
Source File: TabTest.java    From codeexamples-android with Eclipse Public License 1.0 6 votes vote down vote up
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tab);
    TabHost host = (TabHost)findViewById(android.R.id.tabhost);
    TabSpec spec = host.newTabSpec("tab1");
    spec.setContent(R.id.tab1);
    spec.setIndicator("Button1");
    
    host.addTab(spec);
    spec = host.newTabSpec("tab2");
    spec.setContent(R.id.tab2);
    spec.setIndicator("Next Button");
    host.addTab(spec);
    spec = host.newTabSpec("tab3");
    spec.setContent(R.id.tab3);
    spec.setIndicator("Just some text");
    host.addTab(spec);
    
}
 
Example 5
Source File: GestionAlumnos.java    From android with GNU General Public License v2.0 6 votes vote down vote up
private void cargaPestanas() {
	
	Resources res = getResources();
    
    TabHost tabHost = (TabHost) findViewById(R.id.tabhost);
    tabHost.setup();
    
    TabSpec tbListadoAlumnos = tabHost.newTabSpec(res.getString(R.string.listado_alumnos_title));
    	tbListadoAlumnos.setContent(R.id.tab1);
    	tbListadoAlumnos.setIndicator(res.getString(R.string.listado_alumnos_title), res.getDrawable(android.R.drawable.ic_menu_slideshow));
    tabHost.addTab(tbListadoAlumnos);
    
    TabSpec tbNuevoAlumno = tabHost.newTabSpec(res.getString(R.string.nuevo_alumno_title));
 	tbNuevoAlumno.setContent(R.id.tab2);
 	tbNuevoAlumno.setIndicator(res.getString(R.string.nuevo_alumno_title), res.getDrawable(android.R.drawable.ic_menu_edit));
	tabHost.addTab(tbNuevoAlumno);
    
    tabHost.setCurrentTab(0);
    
    tabHost.setOnTabChangedListener(this);
}
 
Example 6
Source File: EmojiPalettesView.java    From openboard with GNU General Public License v3.0 5 votes vote down vote up
private void addTab(final TabHost host, final int categoryId) {
    final String tabId = EmojiCategory.getCategoryName(categoryId, 0 /* categoryPageId */);
    final TabHost.TabSpec tspec = host.newTabSpec(tabId);
    tspec.setContent(R.id.emoji_keyboard_dummy);
    final ImageView iconView = (ImageView)LayoutInflater.from(getContext()).inflate(
            R.layout.emoji_keyboard_tab_icon, null);
    // TODO: Replace background color with its own setting rather than using the
    //       category page indicator background as a workaround.
    iconView.setBackgroundColor(mCategoryPageIndicatorBackground);
    iconView.setImageResource(mEmojiCategory.getCategoryTabIcon(categoryId));
    iconView.setContentDescription(mEmojiCategory.getAccessibilityDescription(categoryId));
    tspec.setIndicator(iconView);
    host.addTab(tspec);
}
 
Example 7
Source File: EmojiPalettesView.java    From AOSP-Kayboard-7.1.2 with Apache License 2.0 5 votes vote down vote up
private void addTab(final TabHost host, final int categoryId) {
    final String tabId = EmojiCategory.getCategoryName(categoryId, 0 /* categoryPageId */);
    final TabHost.TabSpec tspec = host.newTabSpec(tabId);
    tspec.setContent(R.id.emoji_keyboard_dummy);
    final ImageView iconView = (ImageView)LayoutInflater.from(getContext()).inflate(
            R.layout.emoji_keyboard_tab_icon, null);
    // TODO: Replace background color with its own setting rather than using the
    //       category page indicator background as a workaround.
    iconView.setBackgroundColor(mCategoryPageIndicatorBackground);
    iconView.setImageResource(mEmojiCategory.getCategoryTabIcon(categoryId));
    iconView.setContentDescription(mEmojiCategory.getAccessibilityDescription(categoryId));
    tspec.setIndicator(iconView);
    host.addTab(tspec);
}
 
Example 8
Source File: TabTestActivity.java    From ans-android-sdk with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tabhost);
    //获取该activity里面的TabHost组件
    TabHost tabhost=getTabHost();

    //创建第一个tab页对象,TabSpec代表一个选项卡页面,要设置标题和内容,内容是布局文件中FrameLayout中
    TabHost.TabSpec tab1=tabhost.newTabSpec("tab1");
    tab1.setIndicator("已接电话");//设置标题
    tab1.setContent(R.id.tab01);//设置内容
    //添加tab页
    tabhost.addTab(tab1);

    //创建第二个tab页对象
    TabHost.TabSpec tab2=tabhost.newTabSpec("tab1");
    tab2.setIndicator("已拨电话");//设置标题
    tab2.setContent(R.id.tab02);//设置内容
    //添加tab页
    tabhost.addTab(tab2);

    //创建第三个tab页对象
    TabHost.TabSpec tab3=tabhost.newTabSpec("tab1");
    tab3.setIndicator("未接电话");//设置标题
    tab3.setContent(R.id.tab03);//设置内容
    //添加tab页
    tabhost.addTab(tab3);


}
 
Example 9
Source File: MainActivity.java    From AndroidCacheFoundation with Apache License 2.0 5 votes vote down vote up
private void showTabs() {
    initTabInfo();
    tabHost = (TabHost) findViewById(android.R.id.tabhost);
    tabHost.setOnTabChangedListener(this);
    tabHost.setup();

    viewPager = (MyViewPager) findViewById(R.id.viewpager);
    viewPager.setOffscreenPageLimit(5);
    viewPager.setAdapter(new TabAdapter(this, viewPager, tabInfos));
    viewPager.setSwipeEnabled(false);

    for (TabInfo tabInfo : tabInfos) {
        TabHost.TabSpec tabSpec = tabHost.newTabSpec(tabInfo.getId());
        tabSpec.setIndicator(tabInfo.getIndicatorView());
        tabSpec.setContent(new TabHost.TabContentFactory() {

            @Override
            public View createTabContent(String arg0) {
                View v = new View(MainActivity.this);
                v.setMinimumWidth(0);
                v.setMinimumHeight(0);
                return v;
            }
        });
        tabHost.addTab(tabSpec);
    }

}
 
Example 10
Source File: EmojiPalettesView.java    From Indic-Keyboard with Apache License 2.0 5 votes vote down vote up
private void addTab(final TabHost host, final int categoryId) {
    final String tabId = EmojiCategory.getCategoryName(categoryId, 0 /* categoryPageId */);
    final TabHost.TabSpec tspec = host.newTabSpec(tabId);
    tspec.setContent(R.id.emoji_keyboard_dummy);
    final ImageView iconView = (ImageView)LayoutInflater.from(getContext()).inflate(
            R.layout.emoji_keyboard_tab_icon, null);
    // TODO: Replace background color with its own setting rather than using the
    //       category page indicator background as a workaround.
    iconView.setBackgroundColor(mCategoryPageIndicatorBackground);
    iconView.setImageResource(mEmojiCategory.getCategoryTabIcon(categoryId));
    iconView.setContentDescription(mEmojiCategory.getAccessibilityDescription(categoryId));
    tspec.setIndicator(iconView);
    host.addTab(tspec);
}
 
Example 11
Source File: RMBTResultPagerFragment.java    From open-rmbt with Apache License 2.0 5 votes vote down vote up
private View createView(View v, LayoutInflater inflater, int currentPage) {
	tabHost = (TabHost) v.findViewById(android.R.id.tabhost);
	tabHost.setup();
	tabHost.setOnTabChangedListener(this);
	
	for (int i = 0; i < pagerAdapter.getCount(); i++) {
		TabSpec tab = tabHost.newTabSpec(String.valueOf(i));
		//tab.setIndicator(getActivity().getResources().getStringArray(R.array.result_page_title)[i]);
		tab.setContent(android.R.id.tabcontent);
		    		
		
		View indicator = inflater.inflate(R.layout.tabhost_indicator, null);
		TextView title = (TextView) indicator.findViewById(android.R.id.title);
		title.setText(getActivity().getResources().getStringArray(R.array.result_page_title)[RMBTResultPagerAdapter.RESULT_PAGE_TAB_TITLE_MAP.get(i)]);
		
		if (MAP_INDICATOR_DYNAMIC_VISIBILITY) {
			if (i == RMBTResultPagerAdapter.RESULT_PAGE_MAP) {
				indicator.setVisibility(View.GONE);
			}
		}
		tab.setIndicator(indicator);
		
		tabHost.addTab(tab);
	}
	
	scroller = (HorizontalScrollView) v.findViewById(R.id.tabwidget_scrollview);
	
    viewPager = (ExtendedViewPager) v.findViewById(R.id.pager);
    viewPager.setAdapter(pagerAdapter);
    
    viewPager.setOnPageChangeListener(this);
    setCurrentPosition(currentPage);

    return v;
}
 
Example 12
Source File: DocActivityView.java    From Mupdf with Apache License 2.0 5 votes vote down vote up
protected void setupTab(TabHost tabHost, String text, int viewId, int tabId)
{
	View tabview = LayoutInflater.from(tabHost.getContext()).inflate(tabId, null);
	TextView tv = (TextView) tabview.findViewById(R.id.tabText);
	tv.setText(text);

	TabHost.TabSpec tab = tabHost.newTabSpec(text);
	tab.setIndicator(tabview);
	tab.setContent(viewId);
	tabHost.addTab(tab);
}
 
Example 13
Source File: QoSTestDetailPagerFragment.java    From open-rmbt with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState)
{
    super.onCreateView(inflater, container, savedInstanceState);
    
    View v = inflater.inflate(R.layout.result_tabhost_pager, container, false);
	tabHost = (TabHost) v.findViewById(android.R.id.tabhost);
	tabHost.setup();
	tabHost.setOnTabChangedListener(this);
	
	for (int i = 0; i < pagerAdapter.getCount(); i++) {
		TabSpec tab = tabHost.newTabSpec(String.valueOf(i));
		//tab.setIndicator(getActivity().getResources().getStringArray(R.array.result_page_title)[i]);
		tab.setContent(android.R.id.tabcontent);
		    		    		
		View indicator = inflater.inflate(R.layout.tabhost_indicator, null);
		TextView title = (TextView) indicator.findViewById(android.R.id.title);
		title.setText(pagerAdapter.getPageTitle(i));
		tab.setIndicator(indicator);
		tabHost.addTab(tab);
	}

    viewPager = (ExtendedViewPager) v.findViewById(R.id.pager);
    viewPager.setAdapter(pagerAdapter);
    
    viewPager.setOnPageChangeListener(this);
    setCurrentPosition(0);

	scroller = (HorizontalScrollView) v.findViewById(R.id.tabwidget_scrollview);
   	viewPager.setCurrentItem(initPageIndex);
	
    return v;
}
 
Example 14
Source File: AbstractCommentFragment.java    From Plumble with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    LayoutInflater inflater = LayoutInflater.from(getActivity());
    View view = inflater.inflate(R.layout.dialog_comment, null, false);

    mCommentView = (WebView) view.findViewById(R.id.comment_view);
    mCommentEdit = (EditText) view.findViewById(R.id.comment_edit);

    mTabHost = (TabHost) view.findViewById(R.id.comment_tabhost);
    mTabHost.setup();

    if(mComment == null) {
        mCommentView.loadData("Loading...", null, null);
        requestComment(mProvider.getService());
    } else {
        loadComment(mComment);
    }

    TabHost.TabSpec viewTab = mTabHost.newTabSpec("View");
    viewTab.setIndicator(getString(R.string.comment_view));
    viewTab.setContent(R.id.comment_tab_view);

    TabHost.TabSpec editTab = mTabHost.newTabSpec("Edit");
    editTab.setIndicator(getString(isEditing() ? R.string.comment_edit_source : R.string.comment_view_source));
    editTab.setContent(R.id.comment_tab_edit);

    mTabHost.addTab(viewTab);
    mTabHost.addTab(editTab);

    mTabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
        @Override
        public void onTabChanged(String tabId) {
            if("View".equals(tabId)) {
                // When switching back to view tab, update with user's HTML changes.
                mCommentView.loadData(mCommentEdit.getText().toString(), "text/html", "UTF-8");
            } else if("Edit".equals(tabId) && "".equals(mCommentEdit.getText().toString())) {
                // Load edittext content for the first time when the tab is selected, to improve performance with long messages.
                mCommentEdit.setText(mComment);
            }
        }
    });

    mTabHost.setCurrentTab(isEditing() ? 1 : 0);

    AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
    adb.setView(view);
    if (isEditing()) {
        adb.setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                editComment(mProvider.getService(), mCommentEdit.getText().toString());
            }
        });
    }
    adb.setNegativeButton(R.string.close, null);
    return adb.create();
}
 
Example 15
Source File: QoSCategoryPagerFragment.java    From open-rmbt with Apache License 2.0 4 votes vote down vote up
@Override
 public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState)
 {
     if (savedInstanceState != null && savedInstanceState.containsKey(BUNDLE_QOS_RESULTS)) {
     	try {
	setQoSResult(new QoSServerResultCollection(new JSONArray(savedInstanceState.getString(BUNDLE_QOS_RESULTS))));
	setDetailType(DetailType.valueOf(savedInstanceState.getString(BUNDLE_DETAIL_TYPE)));
} catch (JSONException e) {
	//e.printStackTrace();
}
     }
     //DetailType detailType = DetailType.valueOf(args.getString(ARG_DETAIL_TYPE));
     pagerAdapter = new QoSCategoryPagerAdapter((RMBTMainActivity) getActivity(), handler, results);
     
     View v = inflater.inflate(R.layout.result_tabhost_pager, container, false);
 	tabHost = (TabHost) v.findViewById(android.R.id.tabhost);
 	tabHost.setup();
 	tabHost.setOnTabChangedListener(this);
 	
 	for (int i = 0; i < pagerAdapter.getCount(); i++) {
 		TabSpec tab = tabHost.newTabSpec(String.valueOf(i));
 		//tab.setIndicator(getActivity().getResources().getStringArray(R.array.result_page_title)[i]);
 		tab.setContent(android.R.id.tabcontent);
 		    		    		
 		View indicator = inflater.inflate(R.layout.tabhost_indicator, null);
 		TextView title = (TextView) indicator.findViewById(android.R.id.title);
 		title.setText(pagerAdapter.getPageTitle(i));
 		tab.setIndicator(indicator);
 		tabHost.addTab(tab);
 	}

     viewPager = (ExtendedViewPager) v.findViewById(R.id.pager);
     viewPager.setAdapter(pagerAdapter);
     
     viewPager.setOnPageChangeListener(this);
     setCurrentPosition(0);

 	scroller = (HorizontalScrollView) v.findViewById(R.id.tabwidget_scrollview);
 	

     if (initPosition != null) {
     	viewPager.setCurrentItem(initPosition);
     }
 	
     return v;
 }
 
Example 16
Source File: DisplayAlternativeNovelPagerActivity.java    From coolreader with MIT License 4 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
		UIHelper.SetTheme(this, R.layout.activity_display_novel_pager);
		UIHelper.SetActionBarDisplayHomeAsUp(this, true);
		setContentView(R.layout.activity_display_novel_pager);
	} else {
		UIHelper.SetTheme(this, R.layout.activity_display_novel_pager_fix);
		UIHelper.SetActionBarDisplayHomeAsUp(this, true);
		setContentView(R.layout.activity_display_novel_pager_fix);
	}
	tabHost = (TabHost) findViewById(android.R.id.tabhost);
	lam = new LocalActivityManager(this, false);
	lam.dispatchCreate(savedInstanceState);
	tabHost.setup(lam);
	isInverted = UIHelper.getColorPreferences(this);

	tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
		public void onTabChanged(String tabId) {
			setTabColor();
			currentActivity = lam.getActivity(tabId);
		}
	});

	/* Dynamically add Tabs */
	ArrayList<String> Choice = new ArrayList<String>();

	Iterator<Entry<String, AlternativeLanguageInfo>> it = AlternativeLanguageInfo.getAlternativeLanguageInfo().entrySet().iterator();
	while (it.hasNext()) {
		AlternativeLanguageInfo info = it.next().getValue();
		boolean isChosen = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(info.getLanguage(), true);
		if (isChosen) {
			Choice.add(info.getLanguage());
			Log.d("Language Added: ", info.getLanguage());
		}
		it.remove();
	}

	TabSpec[] allSpec = new TabSpec[Choice.size()];
	for (int i = 0; i < Choice.size(); i++) {
		allSpec[i] = tabHost.newTabSpec(Choice.get(i));
		allSpec[i].setIndicator(Choice.get(i));
		Intent firstIntent = new Intent(this, DisplayAlternativeNovelListActivity.class);
		firstIntent.putExtra("LANG", Choice.get(i));
		allSpec[i].setContent(firstIntent);

		// Adding all TabSpec to TabHost
		tabHost.addTab(allSpec[i]);

		// Cheap preload list hack.
		tabHost.setCurrentTabByTag(Choice.get(i));
	}

	// Tab color
	setTabColor();
}
 
Example 17
Source File: DisplayNovelPagerActivity.java    From coolreader with MIT License 4 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
		UIHelper.SetTheme(this, R.layout.activity_display_novel_pager);
		UIHelper.SetActionBarDisplayHomeAsUp(this, true);
		setContentView(R.layout.activity_display_novel_pager);
	} else {
		UIHelper.SetTheme(this, R.layout.activity_display_novel_pager_fix);
		UIHelper.SetActionBarDisplayHomeAsUp(this, true);
		setContentView(R.layout.activity_display_novel_pager_fix);
	}
	tabHost = (TabHost) findViewById(android.R.id.tabhost);
	lam = new LocalActivityManager(this, false);
	lam.dispatchCreate(savedInstanceState);
	tabHost.setup(lam);
	isInverted = UIHelper.getColorPreferences(this);

	// First Tab - Normal Novels
	TabSpec firstSpec = tabHost.newTabSpec(MAIN_SPEC);
	firstSpec.setIndicator(MAIN_SPEC);
	Intent firstIntent = new Intent(this, DisplayLightNovelListActivity.class);
	firstIntent.putExtra(Constants.EXTRA_ONLY_WATCHED, false);
	firstSpec.setContent(firstIntent);

	// Second Tab - Teasers
	TabSpec secondSpec = tabHost.newTabSpec(TEASER_SPEC);
	secondSpec.setIndicator(TEASER_SPEC);
	Intent secondIntent = new Intent(this, DisplayTeaserListActivity.class);
	secondSpec.setContent(secondIntent);

	// Third Tab - Original
	TabSpec thirdSpec = tabHost.newTabSpec(ORIGINAL_SPEC);
	thirdSpec.setIndicator(ORIGINAL_SPEC);
	Intent thirdIntent = new Intent(this, DisplayOriginalListActivity.class);
	thirdSpec.setContent(thirdIntent);

	// Adding all TabSpec to TabHost
	tabHost.addTab(firstSpec); // Adding First tab
	tabHost.addTab(secondSpec); // Adding Second tab
	tabHost.addTab(thirdSpec); // Adding third tab
	//setTabColor();

	tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
		public void onTabChanged(String tabId) {
			//setTabColor();
			currentActivity = lam.getActivity(tabId);
		}
	});

	// Cheap preload list hack.
	tabHost.setCurrentTabByTag(TEASER_SPEC);
	tabHost.setCurrentTabByTag(ORIGINAL_SPEC);
	tabHost.setCurrentTabByTag(MAIN_SPEC);

	Log.d(TAG, "Created");
}
 
Example 18
Source File: DrMIPSActivity.java    From drmips with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates/places the tabs in the Tabhost.
 */
private void createTabs() {
	tabHost = (TabHost)findViewById(android.R.id.tabhost);
	tabHost.setup();

	TabSpec tabCode = tabHost.newTabSpec("tabCode");
	tabCode.setIndicator(getString(R.string.code));
	tabCode.setContent(R.id.tabCode);
	tabHost.addTab(tabCode);
	txtCode = (EditText)findViewById(R.id.txtCode);
	lblFilename = (TextView)findViewById(R.id.lblFilename);
	txtCode.addTextChangedListener(new CodeEditorTextWatcher());
	
	TabSpec tabAssembledCode = tabHost.newTabSpec("tabAssembledCode");
	tabAssembledCode.setIndicator(getString(R.string.assembled));
	tabAssembledCode.setContent(R.id.tabAssembledCode);
	tabHost.addTab(tabAssembledCode);
	tblAssembledCode = (TableLayout)findViewById(R.id.tblAssembledCode);
	cmbAssembledCodeFormat = (Spinner)findViewById(R.id.cmbAssembledCodeFormat);
	cmbAssembledCodeFormat.setOnItemSelectedListener(spinnersListener);
	cmbAssembledCodeFormat.setSelection(DrMIPS.getApplication().getPreferences().getInt(DrMIPS.ASSEMBLED_CODE_FORMAT_PREF, DrMIPS.DEFAULT_ASSEMBLED_CODE_FORMAT));
	
	TabSpec tabDatapath = tabHost.newTabSpec("tabDatapath");
	tabDatapath.setIndicator(getString(R.string.datapath));
	tabDatapath.setContent(R.id.tabDatapath);
	tabHost.addTab(tabDatapath);
	lblCPUFilename = (TextView)findViewById(R.id.lblCPUFilename);
	cmdStep = (ImageButton)findViewById(R.id.cmdStep);
	datapathScroll = (HorizontalScrollView)findViewById(R.id.datapathScroll);
	boolean performanceMode = DrMIPS.getApplication().getPreferences().getBoolean(DrMIPS.PERFORMANCE_MODE_PREF, DrMIPS.DEFAULT_PERFORMANCE_MODE);
	lblDatapathFormat = (TextView)findViewById(R.id.lblDatapathFormat);
	cmbDatapathFormat = (Spinner)findViewById(R.id.cmbDatapathFormat);
	cmbDatapathFormat.setOnItemSelectedListener(spinnersListener);
	cmbDatapathFormat.setSelection(DrMIPS.getApplication().getPreferences().getInt(DrMIPS.DATAPATH_DATA_FORMAT_PREF, DrMIPS.DEFAULT_DATAPATH_DATA_FORMAT));
	lblDatapathFormat.setVisibility(performanceMode ? View.GONE : View.VISIBLE);
	cmbDatapathFormat.setVisibility(performanceMode ? View.GONE : View.VISIBLE);
	lblDatapathPerformance = (TextView)findViewById(R.id.lblDatapathPerformance);
	cmbDatapathPerformance = (Spinner)findViewById(R.id.cmbDatapathPerformance);
	cmbDatapathPerformance.setOnItemSelectedListener(spinnersListener);
	cmbDatapathPerformance.setSelection(DrMIPS.getApplication().getPreferences().getInt(DrMIPS.PERFORMANCE_TYPE_PREF, DrMIPS.DEFAULT_PERFORMANCE_TYPE));
	lblDatapathPerformance.setVisibility(!performanceMode ? View.GONE : View.VISIBLE);
	cmbDatapathPerformance.setVisibility(!performanceMode ? View.GONE : View.VISIBLE);
	tblExec = (TableLayout)findViewById(R.id.tblExec);
	tblExecRow = (TableRow)findViewById(R.id.tblExecRow);
	
	TabSpec tabRegisters = tabHost.newTabSpec("tabRegisters");
	tabRegisters.setIndicator(getString(R.string.registers));
	tabRegisters.setContent(R.id.tabRegisters);
	tabHost.addTab(tabRegisters);
	tblRegisters = (TableLayout)findViewById(R.id.tblRegisters);
	cmbRegistersFormat = (Spinner)findViewById(R.id.cmbRegistersFormat);
	cmbRegistersFormat.setOnItemSelectedListener(spinnersListener);
	cmbRegistersFormat.setSelection(DrMIPS.getApplication().getPreferences().getInt(DrMIPS.REGISTER_FORMAT_PREF, DrMIPS.DEFAULT_REGISTER_FORMAT));
	
	TabSpec tabDataMemory = tabHost.newTabSpec("tabDataMemory");
	tabDataMemory.setIndicator(getString(R.string.data_memory));
	tabDataMemory.setContent(R.id.tabDataMemory);
	tabHost.addTab(tabDataMemory);
	tblDataMemory = (TableLayout)findViewById(R.id.tblDataMemory);
	cmbDataMemoryFormat = (Spinner)findViewById(R.id.cmbDataMemoryFormat);
	cmbDataMemoryFormat.setOnItemSelectedListener(spinnersListener);
	cmbDataMemoryFormat.setSelection(DrMIPS.getApplication().getPreferences().getInt(DrMIPS.DATA_MEMORY_FORMAT_PREF, DrMIPS.DEFAULT_DATA_MEMORY_FORMAT));
}