Possible Duplicate:
On Android, how do you switch activities programatically?
I have built an android application which allows user to login to facebook.For this I've used the faceboook-sdk package.Here is how I login:
mFacebook = new Facebook(APP_ID);
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
if(isSession()){
Intent i = new Intent(getBaseContext(), com.SplashScreen.MultipleOptions.class);
startActivity(i);
}
else
{
Log.d(TAG, "sessionNOTValid, relogin");
mFacebook.authorize(this, PERMS, new LoginDialogListener());
}
And now LoginDialogListener:
private class LoginDialogListener implements DialogListener {
public void onComplete(Bundle values) {
Log.d(TAG, "LoginONComplete");
String token = mFacebook.getAccessToken();
long token_expires = mFacebook.getAccessExpires();
Log.d(TAG, "AccessToken: " + token);
Log.d(TAG, "AccessExpires: " + token_expires);
sharedPrefs = PreferenceManager
.getDefaultSharedPreferences(getBaseContext());
sharedPrefs.edit().putLong("access_expires", token_expires)
.commit();
sharedPrefs.edit().putString("access_token", token).commit();
//mAsyncRunner.request("me", new IDRequestListener());
}
public void onFacebookError(FacebookError e) {
Log.d(TAG, "FacebookError: " + e.getMessage());
}
public void onError(DialogError e) {
Log.d(TAG, "Error: " + e.getMessage());
}
public void onCancel() {
Log.d(TAG, "OnCancel");
}
}
What I wanna do is-once I try to login and if login is succesfully then to move automaticaly to another activity. In this moment after succesfully log in I stay on the same activity.How do I do that???