我正在開發社交應用這個應用程序集成到Facebook的我的應用程序相關的消息發佈到Facebook牆我使用張貼在Facebook上牆消息的Facebook SDK中的Facebook SDK如何使用Facebook的Android SDK中整合Android應用
mPostButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
String message = "Post this to my wall";
Bundle parameters = new Bundle();
parameters.putString("message", message);
mAsyncRunner.request("me/feed", parameters, "POST", new SampleDialogListener());
}
});
mPostButton.setVisibility(mFacebook.isSessionValid() ?
View.VISIBLE :
View.INVISIBLE);
}
public class SampleDialogListener extends BaseDialogListener implements RequestListener {
public void onComplete(Bundle values) {
final String postId = values.getString("post_id");
if (postId != null) {
Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
mAsyncRunner.request(postId, new WallPostRequestListener());
} else {
Log.d("Facebook-Example", "No wall post made");
}
}
public class WallPostRequestListener extends BaseRequestListener {
public void onComplete(final String response, final Object state) {
Log.d("Facebook-Example", "Got response: " + response);
String message = "<empty>";
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);
}
});
}
我使用此代碼不工作發佈消息我的意圖是userlogin Facebook我的字符串是開放的只是發佈牆帖