Code example for FragmentActivity

Methods: getSupportActionBar, onPause

0
    	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
    	} 
    } 
    @Override 
    protected void onPause() { 
    	super.onPause(); 
    	if(sp != null)
			sp.edit().putInt("lastSelectedTab", getSupportActionBar().getSelectedNavigationIndex()).commit();
    } 
     
    @Override 
    protected void onResume() { 
    	super.onResume(); 
    	if(schduledRestart)
    	{ 
    		schduledRestart = false;
    		Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage( getBaseContext().getPackageName() );
    		i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    		startActivity(i);
    	} 
    }