TabHost getCurrentTabTag - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TabHost getCurrentTabTag method.

This code example shows how to use the following methods:getCurrentTabTag
    } 
 
    @Override 
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putString("tab", mTabHost.getCurrentTabTag());
    } 
 
    /** 
     * This is a helper class that implements the management of tabs and all 
     * details of connecting a ViewPager with associated TabHost.  It relies on a 
     * trick.  Normally a tab host has a simple API for supplying a View or 
     * Intent that each tab will show.  This is not sufficient for switching 
     * between pages.  So instead we make the content part of the tab host 
     * 0dp high (it is not shown) and the TabsAdapter supplies its own dummy 
     * view to show as the tab content.  It listens to changes in tabs, and takes 
     * care of switch to the correct paged in the ViewPager whenever the selected 
     * tab changes. 
     */ 
    public static class TabsAdapter extends FragmentPagerAdapter 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag
    } 
 
    @Override 
    protected void onSaveInstanceState(Bundle outState) {
        // Save and restore the selected tab for rotations/restarts. 
        outState.putString("tab", mTabHost.getCurrentTabTag());
    } 
 
    @Override 
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        if (savedInstanceState != null) {
            mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
        } 
    } 
 
    /** 
     * Backwards-compatibility mumbo jumbo 
     */ 
    static class DummyTabFactory implements TabHost.TabContentFactory {
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag
 
	@Override 
	protected void onSaveInstanceState(Bundle outState)
	{ 
		super.onSaveInstanceState(outState);
		outState.putString("tab", mTabHost.getCurrentTabTag());
	} 
 
	/** 
	 * This is a helper class that implements the management of tabs and all 
	 * details of connecting a ViewPager with associated TabHost. It relies on a 
	 * trick. Normally a tab host has a simple API for supplying a View or 
	 * Intent that each tab will show. This is not sufficient for switching 
	 * between pages. So instead we make the content part of the tab host 0dp 
	 * high (it is not shown) and the TabsAdapter supplies its own dummy view to 
	 * show as the tab content. It listens to changes in tabs, and takes care of 
	 * switch to the correct paged in the ViewPager whenever the selected tab 
	 * changes. 
	 */ 
	public static class TabsAdapter extends FragmentPagerAdapter implements TabHost.OnTabChangeListener,
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag, setCurrentTab
            return; 
        } 
 
        // Dismiss menu provided by any children activities 
        Activity activity = getLocalActivityManager().
                getActivity(mTabHost.getCurrentTabTag());
        if (activity != null) {
            activity.closeOptionsMenu();
        } 
 
        // Tell the children activities that they should ignore any possible saved 
        // state and instead reload their state from the parent's intent 
        intent.putExtra(EXTRA_IGNORE_STATE, true);
 
        // Choose the tab based on the inbound intent 
        String componentName = intent.getComponent().getClassName();
        if (getClass().getName().equals(componentName)) {
            if (recentCallsRequest) {
                mTabHost.setCurrentTab(TAB_INDEX_CALL_LOG);
            } else { 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag
                mManager.executePendingTransactions();
            } 
        } 
 
        public void handleDestroyView() { 
            mCurrentTabTag = mTabHost.getCurrentTabTag();
            mTabHost = null;
            mTabs.clear();
            mInitialized = false;
        } 
 
        public void handleSaveInstanceState(Bundle outState) {
            outState.putString("tab", mTabHost != null
                    ? mTabHost.getCurrentTabTag() : mCurrentTabTag);
        } 
 
        @Override 
        public void onTabChanged(String tabId) {
            if (!mInitialized) {
                return; 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag, setCurrentTab
		final boolean recentCallsRequest = Calls.CONTENT_TYPE.equals(intent
				.getType());
 
		// Dismiss menu provided by any children activities 
		Activity activity = getLocalActivityManager().getActivity(
				mTabHost.getCurrentTabTag());
		if (activity != null) {
			activity.closeOptionsMenu();
		} 
 
		// Tell the children activities that they should ignore any possible 
		// saved 
		// state and instead reload their state from the parent's intent 
		intent.putExtra(EXTRA_IGNORE_STATE, true);
 
		// Remember the old manually selected tab index so that it can be 
		// restored if it is 
		// overwritten by one of the programmatic tab selections 
		final int savedTabIndex = mLastManuallySelectedTab;
 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag
    } 
 
    @Override 
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putString("tab", mTabHost.getCurrentTabTag());
    } 
 
    /** 
     * This is a helper class that implements the management of tabs and all 
     * details of connecting a ViewPager with associated TabHost.  It relies on a 
     * trick.  Normally a tab host has a simple API for supplying a View or 
     * Intent that each tab will show.  This is not sufficient for switching 
     * between pages.  So instead we make the content part of the tab host 
     * 0dp high (it is not shown) and the TabsAdapter supplies its own dummy 
     * view to show as the tab content.  It listens to changes in tabs, and takes 
     * care of switch to the correct paged in the ViewPager whenever the selected 
     * tab changes. 
     */ 
    public static class TabsAdapter extends FragmentPagerAdapter 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag
	/** 
	 * Returns the tag of the currently selected tab. 
	 * @return 
	 */ 
	protected String getCurrentTabTag() {
		return mTabHost.getCurrentTabTag();
	} 
 
	 
	@Override 
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		outState.putString(EXTRA_TAB, mTabHost.getCurrentTabTag());
	} 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag
	} 
 
	@Override 
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putString("tab", tabHost.getCurrentTabTag());
    } 
	 
    @Override 
	protected void onResume() { 
		super.onResume(); 
		if(!onCreate) {
			reloadTweak(); 
		} 
		onCreate = false;
	} 
 
    private void reloadTweak() { 
		SysCommand sc = SysCommand.getInstance();
		 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getCurrentTabTag, setCurrentTab
 
    public void setupCurrentTab(Intent intent) {
 
        // Dismiss menu provided by any children activities 
        Activity activity = getLocalActivityManager().getActivity(
                mTabHost.getCurrentTabTag());
        if (activity != null) {
            activity.closeOptionsMenu();
        } 
 
        int missed_call = intent.getIntExtra("missed_call", 0);
        Log.d(TAG, "setupCurrentTab missed_call:" + missed_call);
        if (missed_call == 1) {
            mTabHost.setCurrentTab(TAB_INDEX_MISSED);
        } else { 
            mTabHost.setCurrentTab(TAB_INDEX_ALL);
        } 
    } 
 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java

Related TabHost getCurrentTabTag Questions & Answers:

getCurrentTabTag Method Overview
See Code Examples for other Android TabHost Methods: