I assume that you are executing this bit of code after a successful user authentication?
This bit of code worked for me:
private Facebook mFacebook; private AsyncFacebookRunner mAsyncRunner; private void onFacebookShare() { mFacebook = new Facebook(); mAsyncRunner = new AsyncFacebookRunner(mFacebook); SessionEvents.addAuthListener(new SampleAuthListener()); SessionEvents.addLogoutListener(new SampleLogoutListener()); } private void postToFBWall() { if(mFacebook.isSessionValid()){ shareVideoOnFB(); } else { showDialog(DIALOG_FBOOK_LOGIN); } } public void shareVideoOnFB(){ Bundle params = new Bundle(); params.putString("message", "This string will appear as the status message"); params.putString("link", "This is the URL to go to"); params.putString("name", "This will appear beside the picture"); params.putString("caption", "This will appear under the title"); params.putString("description", "This will appear under the caption"); params.putString("picture", "This is the image to appear in the post"); mAsyncRunner.request("me/feed", params, "POST", new RequestListener() { public void onMalformedURLException(MalformedURLException e) {} public void onIOException(IOException e) {} public void onFileNotFoundException(FileNotFoundException e) {} public void onFacebookError(FacebookError e) {} public void onComplete(String response) { logoutFacebook(); } }); Toast.makeText(ShareActivity.this, "Posting to your Wall...", Toast.LENGTH_SHORT).show(); }
You can call onFacebookShare () in your onCreate () activity, and then when the user clicks everything to indicate that he / she wants to share on Facebook, call postToFBWall (). Of course, you need to add processing to display the login dialog.
source share