2
您好我目前是Android開發的新手,我有一個任務使用意圖傳遞Facebook響應。從Facebook API的返回響應獲取具體數據android
這是我在SplashActivity.java
Request.newMeRequest(session, new Request.GraphUserCallback(){
@Override
public void onCompleted(GraphUser user, Response response) {
Intent intent = new Intent(SplashActivity.this, UserDetailsActivity.class);
GraphObject responseGraphObject = response.getGraphObject();
JSONObject userObj = responseGraphObject.getInnerJSONObject();
intent.putExtra("userobj", userObj.toString());
startActivity(intent);
SplashActivity.this.finish();
}
}).executeAsync();
代碼,並在我的UserDetailsActivity.java我收到的意向數據:
String userObj = getIntent().getExtras().getString("userobj");
的userObj看起來是這樣的: 我怎樣才能得到像first_name,last_name?等的具體數據...
謝謝。