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

  • Home
  • SEARCH
  • 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 7071339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:40:33+00:00 2026-05-28T05:40:33+00:00

With help of this post and this tutorial I have managed to integrate Facebook

  • 0

With help of this post and this tutorial I have managed to integrate Facebook on my Android app with latest FacebookSDK. I want to publish some contents so used the tutorial and its working totally fine. My only issue is that I am not able to see the publish dialog box (as mentioned in the tutorial), where as I want it to be shown as I want user to modify the contents of the message. How do I do this?

Here is a snapshot of the code I am using to publish the post.

public void postToWall(String message){
    Bundle parameters = new Bundle();
            parameters.putString("message", message);
            parameters.putString("description", "topic share");
            try {
                facebook.request("me");

        String response = facebook.request("me/feed", parameters, "POST");

        Log.d("Tests", "got response: " + response);
        if (response == null || response.equals("") ||
                response.equals("false")) {
            showToast("Blank response.");
        }
        else {
            showToast("Message posted to your facebook wall!");
        }
        finish();
    } catch (Exception e) {
        showToast("Failed to post to wall!");
        e.printStackTrace();
        finish();
    }
}

with permissions as

private static final String[] PERMISSIONS = new String[] {"publish_stream"};

I also found that there is something called facebook.dialog() but I have no idea where and how to use it.

So, how do I show the publish dialog box?

  • 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-05-28T05:40:34+00:00Added an answer on May 28, 2026 at 5:40 am

    Code you used will publish on wall without Dialog.

    My only issue is that I am not able to see the publish dialog box (as mentioned in the tutorial), where as I want it to be shown as I want user to modify the contents of the message.

    Use below code snippet to show Dialog :

    private void post_facebook() {
        Bundle parameters = new Bundle();
        parameters.putString("method", "stream.publish");
    
        JSONObject attachment = new JSONObject();
    
        try {
            attachment.put("message", "Messages");
            attachment.put("name", "Check out");
            attachment.put("href", "http://www.google.com");
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    
        parameters.putString("attachment", attachment.toString());
    
        authenticatedFacebook.dialog(Activity.this, "stream.publish",parameters, new TestUiServerListener());
    }
    
        public class TestUiServerListener implements DialogListener {
        public void onComplete(Bundle values) {
            final String postId = values.getString("post_id");
            if (postId != null) {
                new AsyncFacebookRunner(authenticatedFacebook).request(postId,new TestPostRequestListener());
            } else {
                Activity.this.runOnUiThread(new Runnable() {
                    public void run() {
                    }
                });
            }
        }
    
        public void onCancel() {
        }
    
        public void onError(DialogError e) {
            e.printStackTrace();
        }
    
        public void onFacebookError(FacebookError e) {
            e.printStackTrace();
        }
    }
    
    public class TestPostRequestListener implements RequestListener {
        public void onComplete(final String response, final Object state) {
            try {
                JSONObject json = Util.parseJson(response);
                String postId = json.getString("id");
                Activity.this.runOnUiThread(new Runnable() {
                    public void run() {
                    }
                });
            } catch (Throwable e) {
            }
        }
    
        public void onFacebookError(FacebookError e, final Object state) {
            e.printStackTrace();
        }
    
        public void onFileNotFoundException(FileNotFoundException e,
                final Object state) {
            e.printStackTrace();
        }
    
        public void onIOException(IOException e, final Object state) {
            e.printStackTrace();
        }
    
        public void onMalformedURLException(MalformedURLException e,
                final Object state) {
            e.printStackTrace();
        }
    }
    

    Where authenticatedFacebook is Facebook object.

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

Sidebar

Related Questions

I need some help, i have been searching around and cant find the correct
I have read this post and it doesn't answer my question. Stateless session bean
Update: This post was from when I was learning android with android 2.2, be
looking for some help or a blog post really regarding using the auth bundle
I want to use Restlet to process requests for some information, but this information
I've been following this tutorial to learn php so I have a html script:
I need some help creating a query for my mySQL database. I have recently
Hello guys i am new about this implementing facebook into my app.I check developer's
I already have a form with normal HTTP post. Now, I want to rewrite
Please help this would be my last problem in dealing with access database with

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.