Search in sources :

Example 1 with SplashFragment

use of james.alarmio.fragments.SplashFragment in project Alarmio by TheAndroidMaster.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    alarmio = (Alarmio) getApplicationContext();
    alarmio.setListener(this);
    if (savedInstanceState == null) {
        fragment = new SplashFragment();
        getSupportFragmentManager().beginTransaction().add(R.id.fragment, fragment).commit();
    } else {
        if (fragment == null)
            fragment = new HomeFragment();
        getSupportFragmentManager().beginTransaction().replace(R.id.fragment, fragment).commit();
    }
    getSupportFragmentManager().addOnBackStackChangedListener(this);
}
Also used : SplashFragment(james.alarmio.fragments.SplashFragment) HomeFragment(james.alarmio.fragments.HomeFragment)

Aggregations

HomeFragment (james.alarmio.fragments.HomeFragment)1 SplashFragment (james.alarmio.fragments.SplashFragment)1