I am working on a android application in which I need to open a Facebook login window and then after logging successfully, I need to move to another intent (or new screen).
So as soon as user is logged in successfully, it should go to another screen in my app. I am having a very hard time making this thing to work. I have got the sample examples from the Facebook SDK so I was testing it out on those examples, I created another screen named Screen2.java(new xml file) having only a single button just to test it out.
So in my case what it should do is as soon as you are logged in successfully it should go to .Screen2 intent. So I made some changes in the Main.java class mentioned here in this tutorial but it is not working for me. Meaning as soon as I am logged in to Facebook, it doesn’t goes to .Screen2 intent that I have created. Can anyone help me out here?
I made changes only in Main.java class as below by adding new Intent in the method onAuthSucceed()–
public class SampleAuthListener implements AuthListener {
@Override
public void onAuthSucceed() {
mText.setText("You have logged in! ");
// mRequestButton.setVisibility(View.VISIBLE);
// mUploadButton.setVisibility(View.VISIBLE);
// mPostButton.setVisibility(View.VISIBLE);
Intent i = new Intent(Main.this, Screen2.class);
startActivity(i);
}
@Override
public void onAuthFail(String error) {
mText.setText("Login Failed: " + error);
}
}
NOTE:- I am able to login into Facebook but after logging successfully, it doesn’t goes to my new Intent.
Any help will be appreciated.
I was under the impression you needed something like this