Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to post on facebook wall using Facebook android SDK, without opening dialog box
    text
    copied!<p>I am using facebook sdk and with the help of example given with that SDK i developed a code to login and store access_token into database</p> <p>i have 2 problems:</p> <p>1). when i try to fetch access_token from database and pass it to facebook it doesn't allow me to post on wall using that example given with that facebook sdk, why is that so??</p> <p>2). i gone through that facebook.java code, but what i got is that to post on a wall i got to open a dialogue box as there is no other method to pass my message straight away and post. Please tell me solution towards it or tel me wat should i do when i want to post on a wall without opening a dialogue box</p> <pre><code> mPostButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { String message = "Post this to my wall"; Bundle params = new Bundle(); params.putString("message", message); mAsyncRunner.request("me/feed", params, "POST", new WallPostRequestListener()); } }); public class WallPostRequestListener extends BaseRequestListener { public void onComplete(final String response) { Log.d("Facebook-Example", "Got response: " + response); String message = "&lt;empty&gt;"; try { JSONObject json = Util.parseJson(response); message = json.getString("message"); } catch (JSONException e) { Log.w("Facebook-Example", "JSON Error in response"); } catch (FacebookError e) { Log.w("Facebook-Example", "Facebook Error: " + e.getMessage()); } final String text = "Your Wall Post: " + message; Example.this.runOnUiThread(new Runnable() { public void run() { mText.setText(text); } }); } } </code></pre> <p>Whats wrong with above code.. its not posting on wall and giving me Wall Post: empty on phone and emulator both</p> <p>Thanks in advance..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload