In the method onOptionsItemSelectedMenu
I have a AlertDialog.Builder
I am opening a WebView inside this AlertDialog.
However, I want to change the size of the AlertDialog.Builder, I want to change width and height according to my decision.I read a lot of questions here, but strangely nothing worked. Especially this article: How to make an alert dialog fill 90% of screen size? How can I change the size of it ? I want to change it programmatically. I don't inflate any layout or anything else.
Here is my little code:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_inner_basics) {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
android.webkit.WebView wv = new WebView(this);
wv.loadUrl("file:///android_asset/test.html");
AlertDialog alertDialog = alert.create();
alertDialog.setView(wv);
alertDialog.show();
}
return super.onOptionsItemSelected(item);
}