Skip User registration activities already logged in the application

Asked

Viewed 59 times

0

Good afternoon.

I wish I knew the best way to jump Activities of registration when initializing the application on Android when the user is already registered in the application, as occurs on Facebook and other applications that require login.

The ideal way would be to consult at the bank SQLite if the user is already existing and create a Intent in the creation of this first Activity and then re-order to another Activity? Or what other way would they use? Is there a way to access the application without creating the Activity that the application is started for the first time?

1 answer

2


Your initial activity can be like this (note that there is no setContentView()):

public class ActivityInicial extends Activity {

    @Override
    public void onCreate() {
        if (usuarioLogado()) {
            chamarActivityPrincipal();
        } else {
            chamarActivityDeLogin();
        }
        finish();
    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.