I have an activity with
android:theme="@android:style/Theme.Dialog"
to show it as float window. Also I have a line
getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
And I need a width/height of this window to show content correctly.
I've tested four options and did not get an answer:
//1
int width = getWindowManager().getDefaultDisplay().getWidth();
//2
int width = getWindow().getDecorView().getWidth();
//3
getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
//4
int width = getWindow().getAttributes().width;
Thanks!