Fixed an issue with the login activity.

This commit is contained in:
Pierre 2018-04-14 17:30:16 +02:00
parent 226404a2c4
commit 636c74bc98

View File

@ -69,6 +69,15 @@ public class LoginActivity extends AppCompatActivity {
}
@Override
protected void onResume() {
super.onResume();
//If the user is signed in, open the main activity
if(new AccountHelper(this).signed_in())
openMainActivity();
}
/**
* Handle login form submission
*/
@ -186,8 +195,7 @@ public class LoginActivity extends AppCompatActivity {
}
else {
//Redirect to the main activity
Intent redirect = new Intent(LoginActivity.this, MainActivity.class);
startActivity(redirect);
openMainActivity();
}
}
@ -195,6 +203,14 @@ public class LoginActivity extends AppCompatActivity {
}
/**
* Open the main activity
*/
private void openMainActivity(){
Intent redirect = new Intent(LoginActivity.this, MainActivity.class);
startActivity(redirect);
}
/**
* Switch between loading state and ready state for the login form
*