Code example for FragmentActivity

Methods: getBaseContext, onResume, startActivity

0
			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);
    	} 
    } 
}