0
我舉了一個小例子,通過Android應用向Facebook供稿發佈消息。 它工作的很好,但我只是想添加更多的內容,像Facebook頁面的圖標,鏈接和更多的東西..將內容添加到來自Android應用的Facebook供稿
我怎樣才能將這些參數添加到我的Facebook對話框以發佈它們呢?
public class MainActivity extends Activity
{
Facebook facebook = new Facebook("Here i got my app id.");
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Posting my message, maybe here i could add paramterers like icon and a link etc..?
facebook.dialog(MainActivity.this, "feed", new PostDialogListener());
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
facebook.authorizeCallback(requestCode, resultCode, data);
}
public abstract class BaseDialogListener implements DialogListener {
@Override
public void onFacebookError(FacebookError e) {
e.printStackTrace();
}
@Override
public void onError(DialogError e) {
e.printStackTrace();
}
@Override
public void onCancel() {
}
}
public class PostDialogListener extends BaseDialogListener {
@Override
public void onComplete(Bundle values) {
final String postId = values.getString("post_id");
if (postId != null) {
ki("Message posted on the wall.");
} else {
ki("No message posted on the wall.");
}
}
}
}
PostPhotoDialogListener不能被解析爲一個類型, 我怎麼能實現它,請幫我 –
你想用對話或不對話 – Venky
後得到了現在的感謝。 –