私のアプリでは、Google ドキュメントの URL を webview に読み込んでおり、その webview をアラート ダイアログの一部として表示しています。以下は私が使用しているコードです:
AlertDialog.Builder alert = new AlertDialog.Builder(
MockExamActivity.this);
alert.setTitle(R.string.writing_title);
WebView wv = new WebView(MockExamActivity.this);
wv.getSettings().setJavaScriptEnabled(true);
wv.loadUrl("https://docs.google.com/file/d/string/edit?usp=sharing");
wv.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view,
String url) {
view.loadUrl(url);
return true;
}
});
alert.setNegativeButton("Close",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
}
});
Dialog d = alert.setView(wv).create();
d.show();
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(d.getWindow().getAttributes());
lp.width = WindowManager.LayoutParams.FILL_PARENT;
lp.height = WindowManager.LayoutParams.FILL_PARENT;
d.getWindow().setAttributes(lp);
しかし、私が見ているのは次のとおりです。
ダイアログを全画面スペースにするにはどうすればよいですか?