1

I want to paly video in full screen. and i set xml like this

android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"

it works fine in android 4.1, but do not work in android 4.2

aotian16
  • 767
  • 1
  • 10
  • 21

2 Answers2

0

Use

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
Bhoomika Brahmbhatt
  • 7,404
  • 3
  • 29
  • 44
0

Do you mean hide the status bar at the same time? Add the following line before setContentView.

Further more, custom a view, extends from VideoView, and override the onMeasure() to full screen size.

Isaiah
  • 432
  • 2
  • 6
  • thank you.I have tried override `protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { DisplayMetrics dm = getResources().getDisplayMetrics(); int screenWidth = dm.widthPixels; int screenHeight = dm.heightPixels; setMeasuredDimension(screenWidth, screenHeight); }` and it do not work on 4.2 too – aotian16 Sep 06 '13 at 02:07