Session session = Session.getActiveSession();
if(session != null){
Bundle postParams = new Bundle();
postParams.putString("name", "몽키3 추천음악");
postParams.putString("caption", "-girls day-");
postParams.putString("description", "걸스데이랑께");
postParams.putString("link", "http://www.monkey3.co.kr/#/etc.album&albumID=185582");
postParams.putString("picture", "http://imgtest.monkey3.co.kr/get_image.php?type=album&id=185582&w=100");
System.out.println("실행");
Request.Callback callback= new Request.Callback() {
public void onCompleted(Response response) {
JSONObject graphResponse = response.getGraphObject().getInnerJSONObject();
String postId = null;
try {
postId = graphResponse.getString("id");
Toast.makeText(
MainActivity.this,
"등록성공",
Toast.LENGTH_SHORT).show();
} catch (JSONException e) {
Log.i("UnityFacebookTest","JSON error "+ e.getMessage());
}
FacebookRequestError error = response.getError();
if (error != null) {
Toast.makeText(MainActivity.this, error.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
else {
Toast.makeText(MainActivity.this, postId, Toast.LENGTH_LONG).show();
}
}
};
Request request = new Request(session, "/me/feed", postParams, HttpMethod.POST, callback);
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
}
}
실행시키면 널포인터라고 오류가 뜨네요...
아직 허접이라서...많은 도움 부탁드립니다... 구글링해도 소스가 다 비슷해서 어떻게 수정해야할지...ㅠㅠㅠ