As far as I know changing launcher programmatically is not possible, but it also doesn't make sense.
On your LoginActivity's onCreate
check if a username and token is already saved, if it is try to login with that automatically, is succeed redirect to your MainAcivity. Depending on the way your app works you can have a variable that checks if a user is logged in or not, if he is the LoginActivity would redirect him to MainActivity without trying to log in again.
//LoginActivity
onCreate(Bundle bundle)
{
/* ... */
//Or whatever you use to login (it could also go inside a thread or an AsyncTask
if (login())
{
//Intent
Intent intent = new Intent(this, MainActivity.class);
//Start Activity
startActivity(intent);
//Finish this activity, so when user pressed back the login activity will not come forth and the app will exit
//this looks like when a user has logged in once, the login screen will not be visible to him (unless you want to)
finish();
}
}
You can also configure it to save username and token only if a login is successful which means the above code can be modified like this:
if (getUsername() != null)
{
/* Start Main Activity */
}
This won't attempt to log in, but it knows the credential are right since it has logged in at least once with them.
If your app behaves a different way that these methods do not work, feel free to say so, I may be able to provide more info