public class MainActivity extends Activity { private SharedPreferences sharedPreferences; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // you dont actually need the context variable // inside of an activity class you can pass it as this and that will work // it just reads a bit better context = this; sharedPreferences = PreferenceManager .getDefaultSharedPreferences(context); switch (checkAppStart(this,sharedPreferences)) { case NORMAL: // We don't want to get on the user's nerves break; case FIRST_TIME_VERSION: // TODO show what's new break; case FIRST_TIME: // TODO show a tutorial break; default: break; } // ... } // ... }