根本的な問題は、Facebook API がまだすべての表示タイプに対応していないことと、友達ダイアログをモバイル ディスプレイに表示できないことです。できることは、Facebook Android ライブラリを変更することです。ダイアログを開くときに、「タッチ」の代わりに「ポップアップ」表示モードを使用し、m.facebook.com の代わりに www.facebook.com を使用すると、適切なウィンドウがFacebook ライブラリの標準 WebView。
このために、Facebook.java のダイアログ関数を次のように変更します。
protected static String DIALOG_BASE_URL = "https://m.facebook.com/dialog/";
protected static String DIALOG_BASE_URL_FOR_MISSING_SCREENS = "https://www.facebook.com/dialog/";
public void dialog(Context context, String action, Bundle parameters,
final DialogListener listener) {
boolean missingScreen = action.contentEquals("friends") ? true : false;
String endpoint = missingScreen ? DIALOG_BASE_URL_FOR_MISSING_SCREENS : DIALOG_BASE_URL;
endpoint += action;
parameters.putString("display", missingScreen ? "popup" : "touch");
parameters.putString("redirect_uri", REDIRECT_URI);
if (action.equals(LOGIN)) {
parameters.putString("type", "user_agent");
parameters.putString("client_id", mAppId);
} else {
parameters.putString("app_id", mAppId);
}
if (isSessionValid()) {
parameters.putString(TOKEN, getAccessToken());
}
String url = endpoint + "?" + Util.encodeUrl(parameters);
if (context.checkCallingOrSelfPermission(Manifest.permission.INTERNET)
!= PackageManager.PERMISSION_GRANTED) {
Util.showAlert(context, "Error",
"Application requires permission to access the Internet");
} else {
new FbDialog(context, url, listener).show();
}
}
その後、ダイアログからダブル タイトル バーを削除することもできます。FbDialog.java に移動し、onPageFinished のようなものを挿入します。
if (url.contains("friends?")) {
mTitle.setHeight(0);
mTitle.setVisibility(View.INVISIBLE);
}