TabHost getCurrentView - 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 getCurrentView method.

This code example shows how to use the following methods:getCurrentTab, getCurrentView
    } 
    private int lastTab = 3;
    private View lastTabView;
 
    public void onTabChanged(String tabId) {
        if (lastTab == tabHost.getCurrentTab()) {
            return; 
        } 
        if (((LiqoidApplication) getApplication()).getGlobalPreferences().getBoolean("animations", false)) {
            if (lastTab > tabHost.getCurrentTab()) {
                tabHost.getCurrentView().setAnimation(inFromLeftAnimation());
                lastTabView.setAnimation(outToRightAnimation());
 
            } else { 
                tabHost.getCurrentView().setAnimation(inFromRightAnimation());
                lastTabView.setAnimation(outToLeftAnimation());
 
            } 
        } 
        lastTab = tabHost.getCurrentTab();

5
CodeRank
This code example shows how to use the following methods:getCurrentTab, getCurrentView, setCurrentTab
		return super.dispatchTouchEvent(event);
 
	} 
     
	private void scrollTo(int index) {
		int mCurrentTabID = mTabHost.getCurrentTab();
		View currentView = mTabHost.getCurrentView();
		int tabCount = getTabWidget().getChildCount();
		if (null != currentView) {
			if (mCurrentTabID == (tabCount - 1) && index == 0) {
				currentView.startAnimation(slideLeftOut);
			} else if (mCurrentTabID == 0 && index == (tabCount - 1)) {
				currentView.startAnimation(slideRightOut);
			} else if (index > mCurrentTabID) {
				currentView.startAnimation(slideLeftOut);
			} else if (index < mCurrentTabID) {
				currentView.startAnimation(slideRightOut);
			} 
		} 
		mTabHost.setCurrentTab(index);

5
CodeRank
This code example shows how to use the following methods:getCurrentView, getTabContentView
			} 
		} 
	} 
 
	public static void showActivity(Intent newintent) {
		tabHost.getTabContentView().removeView(tabHost.getCurrentView());
		currentview = getContentView(newintent);
		tabHost.getTabContentView().addView(currentview);
	} 
 
	public static View getContentView(Intent mIntent) {
		if (mLocalActivityManager == null) {
			throw new IllegalStateException("Did you forget to call 'public void setup(LocalActivityManager activityGroup)'?");
		} 
		final Window w = mLocalActivityManager.startActivity(System.currentTimeMillis() + "", mIntent);
		final View wd = w != null ? w.getDecorView() : null;
		return wd;
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:getCurrentTab, getCurrentView
     */ 
    @Override 
    public void onTabChanged(String tabId)
    { 
 
        currentView = tabHost.getCurrentView();
        if (tabHost.getCurrentTab() > currentTab)
        { 
            previousView.setAnimation(outToLeftAnimation());
            currentView.setAnimation(inFromRightAnimation());
        } 
        else 
        { 
            previousView.setAnimation(outToRightAnimation());
            currentView.setAnimation(inFromLeftAnimation());
        } 
        previousView = currentView;
        currentTab = tabHost.getCurrentTab();
 
    } 

4
CodeRank
This code example shows how to use the following methods:getCurrentTab, getCurrentView
     */ 
    @Override 
    public void onTabChanged(String tabId)
    { 
 
        currentView = tabHost.getCurrentView();
        if (tabHost.getCurrentTab() > currentTab)
        { 
            previousView.setAnimation(outToLeftAnimation());
            currentView.setAnimation(inFromRightAnimation());
        } 
        else 
        { 
            previousView.setAnimation(outToRightAnimation());
            currentView.setAnimation(inFromLeftAnimation());
        } 
        previousView = currentView;
        currentTab = tabHost.getCurrentTab();
 
    } 

4
CodeRank
This code example shows how to use the following methods:getCurrentView
	@Override 
	/** 
	 * when tab is changed 
	 */ 
	public void onTabChanged(String tabId) {
		tabHost.getCurrentView().onWindowFocusChanged(true);
		//mBoundService.runService(); 
	} 
 
	@Override 
	/** 
	 * when Activity is destroyed 
	 */ 
	public void onDestroy(){ 
		super.onDestroy(); 
		stopService(new Intent(this, GPSNotifyService.class));
	} 
 
	/** 
	 * builds alert box for no GPS signal 
4
CodeRank

Related TabHost getCurrentView Questions & Answers:

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