-1
可能重複:
Android: how to get the app name into our textviewFacebook的SDK,如何申請程序名稱
喜IAM試圖從Facebook獲得應用程序的名字,但沒有success..doing如下
String queryApp = "SELECT namespace FROM application WHERE app_id=xxxxxxxxxxx";
Bundle paramsApp = new Bundle();
paramsApp.putString("method", "fql.query");
paramsApp.putString("query", queryApp);
String resultApp = Util.facebook.request(paramsApp);
Log.e("APP RESULT", resultApp);
JSONArray JAApp = new JSONArray(resultApp);
for (int i = 0; i < JAApp.length(); i++) {
JSONObject JOApp = JAApp.getJSONObject(i);
String getDisplayName = JOApp.getString("display_name");
Log.e("DISPLAY NAME", getDisplayName);
}
上面的代碼不工作..我可以使用facebookasyncrunner達到此目的
Facebook facebook = new Facebook(YOUR_APP_ID);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
// all your paramsApp bundle code
...
mAsyncRunner.request(paramsApp, new BaseRequestListener() {
...
});
但bot確定如何使用它...任何建議表示讚賞。