public void onResume() { super.onResume(); if (!prefs.getGoingToInfo()) { if (prefs.getKey().equals("")) { Intent loginIntent = new Intent().setClass(UcheckAndroidMain.this, Login.class); UcheckAndroidMain.this.startActivity(loginIntent); } else { tabHost.setCurrentTab(lastTab); } } else { prefs.setGoingToInfo(false); } }