Search in sources :

Example 1 with Preferences

use of com.a5corp.weather.preferences.Preferences in project Weather by Sparker0i.

the class GlobalActivity method onResume.

@Override
protected void onResume() {
    cp = new Preferences(this);
    prefs = new Prefs(this);
    super.onResume();
    if (prefs.getNotifs())
        startService(new Intent(this, NotificationBuilderService.class));
    if (!cp.getPrefs().getBoolean("first", true)) {
        prefs.setLaunched();
        prefs.setCity(cp.getCity());
    }
    super.onResume();
    Intent intent;
    if (prefs.getLaunched()) {
        intent = new Intent(GlobalActivity.this, WeatherActivity.class);
    } else {
        intent = new Intent(GlobalActivity.this, FirstLaunch.class);
    }
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
    startActivity(intent);
}
Also used : Intent(android.content.Intent) FirstLaunch(com.a5corp.weather.activity.FirstLaunch) WeatherActivity(com.a5corp.weather.activity.WeatherActivity) Preferences(com.a5corp.weather.preferences.Preferences) Prefs(com.a5corp.weather.preferences.Prefs)

Aggregations

Intent (android.content.Intent)1 FirstLaunch (com.a5corp.weather.activity.FirstLaunch)1 WeatherActivity (com.a5corp.weather.activity.WeatherActivity)1 Preferences (com.a5corp.weather.preferences.Preferences)1 Prefs (com.a5corp.weather.preferences.Prefs)1