Reputation: 209
I'm trying to open a facebook post dialog when I click on some element. Dialog itself is working well. I could write some comments in the text field and the post could be seen on the website. However I want to add some info the area below the comment, which contains caption, link, picture and so on. I referred to several tutorials to implement this but they didn't work for me. Say, the caption I entered would not be shown in the dialog. The code is like:
mFacebook = new Facebook(APP_ID);
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
dFbPostButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Bundle b = new Bundle();
b.putString("caption","Check This Hotel");
//Result is the class name
//Nothing too much in SampleDialogListener
mFacebook.dialog(Result.this, "feed", b,new SampleDialogListener());
}
}
Any help would be really appreciated!!
Upvotes: 1
Views: 463
Reputation: 896
Follow the below code
Bundle params = new Bundle();
params.putString("caption", "Mona Lisa");
params.putString("description","The Mona Lisa...");
params.putString("picture","http://tineye.com/images/widgets/mona.jpg");
params.putString("name", "Mona Lisa");
mFacebook.dialog(this, "feed", params, new DialogListener() {
@Override
public void onComplete(Bundle values) {}
@Override
public void onCancel() {}
@Override
public void onError(DialogError de) {}
@Override
public void onFacebookError(FacebookError fbe) {}
});
it ll help
Upvotes: 2