I have an activity with ListView that has:
android:theme="@android:style/Theme.Dialog"
in Manifest. When I open it and when it has only one line in ListView, the window that opens is very small. How do I make the window take the whole screen?
Use this in your onCreate method of the Activity to make it full screen.
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
setContentView(R.layout.myxml);
LayoutParams params = getWindow().getAttributes();
params.height = LayoutParams.MATCH_PARENT;
params.width = LayoutParams.MATCH_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With