使用 Facebook SDK 示例,我可以使用 Facebook 登录,但现在我需要在墙上发布消息,我不明白该怎么做。这是我的代码 public class CondividiSuFacebookActivity extends Activity{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.facebook_condividi);
String msg = (String)getIntent().getStringExtra("message");
// start Facebook Login
Session.openActiveSession(this, true, new Session.StatusCallback()
{
// callback when session changes state
public void call(Session session, SessionState state, Exception exception)
{
if (session.isOpened())
{
// make request to the /me API
Request.executeMeRequestAsync(session, new Request.GraphUserCallback()
{
// callback after Graph API response with user object
public void onCompleted(GraphUser user, Response response)
{
if (user != null)
{
TextView welcome = (TextView) findViewById(R.id.welcome);
welcome.setText("Hello " + user.getName() + "!");
}
}
});
}
}
});
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
}
}
我找到了这个功能:
Request.newStatusUpdateRequest(session, "Hello!", new Request.Callback() {
public void onCompleted(Response response) {
// TODO Auto-generated method stub
}
});
但我不明白如何使用它。有什么建议么?谢谢