-1
In my application I made a login screen and put a button to authenticate the user through Facebook, after logging in the main screen and on this screen has a button that calls a new Activity. So far so good. Now the problem, went to put a button on the login screen to authenticate the user by Google, he logs in and opens the main screen, the same as the login with Facebook, but when I click on the button to open the new Activity instead of opening the new screen is going back to the login screen
Button code Da Mainactivity
Button Config= (Button) findViewById(R.id.Config);
PerfilButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this,Config.class));
}
});
Code to open the main activity
private void goMainScreen() {
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
That one goMainScreen() is used to call the main screen after the user logs in by Google
When logging in with Facebook everything works well, but when logging in with Google gives problem when clicking the button to open the new Activity.
I think the error may be on the button, but I don’t understand why it works well when logging in with Facebook but not with Google, if the two ways of logging in open the same screen
The problem may even be in the button, but if it works with one and not the other, possibly the issue is in the integration of Google login. In the first snippet, you declare the button
Config
, but defines thePerfilButton
. Maybe you need to expose more code to make it clear.– Rene Freak