Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8244099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:44:03+00:00 2026-06-07T21:44:03+00:00

At the oficial facebook developers tutorial, they say posting in users Wall on facebook

  • 0

At the oficial facebook developers tutorial, they say posting in users Wall on facebook is as easy as writing this single line:

mFacebook.dialog(context, "feed", new PostDialogListener());

but when I try to use this, it keeps asking me to create the PostDialogListener class. Isn’t that included with facebook sdk? where can I find this class?

and, to logout, I must use this:

mAsyncRunner.logout(getContext(), new RequestListener() {
@Override
public void onComplete(String response, Object state) {}

@Override
public void onIOException(IOException e, Object state) {}

@Override
public void onFileNotFoundException(FileNotFoundException e,
    Object state) {}

@Override
public void onMalformedURLException(MalformedURLException e,
    Object state) {}

@Override
public void onFacebookError(FacebookError e, Object state) {}
});

And then I’m asked to create getContext() method.

Facebook’s tutorial is very incomplete, what must I do now? Thanks!

Edit: My facebook activity is very simple, i just connect and retrieve data from user, then pass it to another activity. I wat to implement a logout method, and also ask user to post on wall after login (that would be in another activity)

public class FacebookConnectActivity extends Activity {
private static final String TAG_JSON = "json";
Facebook facebook = new Facebook("12121212112");
AsyncFacebookRunner mAsyncRunner;
private SharedPreferences mPrefs;
JSONObject json;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.resgatar_produto_layout);


    mPrefs = getPreferences(MODE_PRIVATE);
    String access_token = mPrefs.getString("access_token", null);
    long expires = mPrefs.getLong("access_expires", 0);
    if(access_token != null) {
        facebook.setAccessToken(access_token);
    }
    if(expires != 0) {
        facebook.setAccessExpires(expires);
    }

    if(!facebook.isSessionValid()) {

    facebook.authorize(this, new String[] {"email", "user_birthday",     "publish_actions"}, new DialogListener() {
        @Override
        public void onComplete(Bundle values) {}

        @Override
        public void onFacebookError(FacebookError error) {}

        @Override
        public void onError(DialogError e) {}

        @Override
        public void onCancel() {}   
    });

    }

}

public void logoutFB(){

}



@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    facebook.authorizeCallback(requestCode, resultCode, data);
    try{
        json = Util.parseJson(facebook.request("me"));
        Log.e("FacebookConnect", "JSON " + json.toString());
    }catch (JSONException e) {
        Log.e("FacebookConnect", "JSONException " + e.toString());
    }catch(FacebookError fbe){
        Log.e("FacebookConnect", "FacebookError " + fbe.toString());
    }catch (Exception e){
        Log.e("FacebookConnect", "Exception " + e.toString());
    }

    Intent a = new Intent(FacebookConnectActivity.this, FacebookDataProcess.class);
    a.putExtra(TAG_JSON, json.toString());
    startActivity(a);
    finish();
}   
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:44:06+00:00Added an answer on June 7, 2026 at 9:44 pm

    I think I’ve just got something that works:

    in FacebookConnectActivity:

    public static  void logoutFB(){
        if(facebook.isSessionValid()){
            facebook.setAccessToken(null);
        }
    }
    

    This method is called in a logoutbutton.onclick just like this:

    FacebookConnectActivity.logoutFB();
    

    Maybe it helps someone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI I am using faceobok connect and the official Facebook tutorial below: https://developers.facebook.com/docs/mobile/ios/build/ Now
I've just read this https://developers.facebook.com/docs/reference/dialogs/feed/ It says since the 12th of July 2011 it
I am writing an iphone program which use facebook and twitter api.But I can't
following official freebase facebook app tutorial , in Step 4 it mentions the Acre
Edit: Made an official bug report at developers.Facebook.com GETing either of the following: graph.facebook.com/me/photos
At this url , Facebook explains how to authenticate using Facebook Connect. Basically, the
I'm using Omniauth with Devise to authenticate users via Facebook for a web app
I found this code: $request_url =https://graph.facebook.com/comments/?ids= . $purl; $requests = file_get_contents($request_url); $fb_response = json_decode($requests);
I did the Facebook Registration Plugin like in the official Facebook tutorial and with
I'm trying to integrate Facebook sharing into a webpage using this code edited from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.