-1

I followed facebook integration to my app through this link, https://developers.facebook.com/docs/android/getting-started/ but in this link

  if (user != null) {
            TextView welcome = (TextView) findViewById(R.id.welcome);
            welcome.setText("Hello " + user.getName() + "!");
          }

after completion of facebook login it is showing user value as null.. after completion of login if(user!=null) then I want to go to the home page of my app .. please suggest me to do this

thanks in advance.


can any one tell how to login as single-sign-on to facebook using code in this link

http://www.androidhive.info/2012/03/android-facebook-connect-tutorial/

using this code is asking login everytime when I run the app. can you please suggest me how to avoid this.


if I loggedin in facebook installed in my mobile then my app will open directly without asking login page of facebook , if default facebook in mobile is not logged in with any user then my app will ask login to the facebook how to do that using androidhive link code can you please explain it ...

1 Answer 1

0

This is how I have done it. Check out this source code: https://github.com/madhur/MapMyLocation/blob/develop/src/in/co/madhur/mapmylocation/activity/FBLogin.java

Request meRequest=Request.newMeRequest(session, new GraphUserCallback()
                                {

                                        @Override
                                        public void onCompleted(GraphUser user, Response response)
                                        {
                                                if(response.getError()==null)
                                                {

                                                        appPreferences.setFBUserName(user.getName());
                                                }

                                        }
                                });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.