Placing onPause in Activity where it handles variable

view story

http://stackoverflow.com – I am in need of a little help with placing onPause in my code. This is my onPause method I was suggested earlier today @Override public void onPause() { if (alertDialog != null && alertDialog.isShowing()) { alertDialog.dismiss(); super.onPause(); } } My activity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final SharedPreferences settings = getSharedPreferences("pref_name", 0); boolean disappear = settings.getBoolean("installed", false); if (disappear == false) (HowTos)