Search in sources :

Example 1 with FragmentActivation

use of net.iGap.fragments.FragmentActivation in project iGap-Android by KianIranian-STDG.

the class ActivityRegistration method onBackPressed.

@Override
public void onBackPressed() {
    Log.wtf(this.getClass().getName(), "onBackPressed 0");
    Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.registrationFrame);
    if (!(fragment instanceof FragmentActivation) && !(fragment instanceof FragmentRegistrationNickname)) {
        if (getSupportFragmentManager().getBackStackEntryCount() > 1) {
            Log.wtf(this.getClass().getName(), "onBackPressed");
            super.onBackPressed();
        } else {
            if (getIntent().getBooleanExtra("add account", false)) {
                new AccountHelper().changeAccount();
                Log.wtf(this.getClass().getName(), "current user: " + AccountManager.getInstance().getCurrentUser());
                finish();
                startActivity(new Intent(this, ActivityMain.class));
            } else {
                Log.wtf(this.getClass().getName(), "finish");
                finish();
            }
        }
    }
}
Also used : AccountHelper(net.iGap.module.accountManager.AccountHelper) FragmentRegistrationNickname(net.iGap.fragments.FragmentRegistrationNickname) Intent(android.content.Intent) Fragment(androidx.fragment.app.Fragment) WelcomeFragment(net.iGap.fragments.WelcomeFragment) FragmentActivation(net.iGap.fragments.FragmentActivation)

Aggregations

Intent (android.content.Intent)1 Fragment (androidx.fragment.app.Fragment)1 FragmentActivation (net.iGap.fragments.FragmentActivation)1 FragmentRegistrationNickname (net.iGap.fragments.FragmentRegistrationNickname)1 WelcomeFragment (net.iGap.fragments.WelcomeFragment)1 AccountHelper (net.iGap.module.accountManager.AccountHelper)1