Android Full Width Video View
android, layout, video
Solution
You can get current height and width of the screen using display matrix
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int h = displaymetrics.heightPixels;
int w = displaymetrics.widthPixels;
Now use this height and width for your video view :) use it programmatically not hardcode it like 720dp and all. `getWidth()` and `getHeight()` are deprecated by the google
Problem
I am trying to stretch my video view inside the linear layout to full screen but it doesn't match the device screen. Here is my code ``` <LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="720dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_gravity="fill_horizontal" android:layout_marginTop="140dp" > <VideoView android:id="@+id/videoView1" android:layout_width="fill_parent" android:layout_height="720dp" /> </LinearLayout> ``` There is always 10 to 15 dp space on left and right each. Also the Linear layout is not stretching to full screen. I want it to fill the screen in width.