views:

73

answers:

1

My app plays a video using VideoView. I am using a LinearLayout to add some text, the video and then some buttons.

My question is what kind of layout params can I use for the VideoView to make sure it plays well in all phones? Basically, when in portrait mode, I want the complete width to be used, and video height to be used. When in landscape, I would like it to look more like the full screen mode.

I have noticed that this setting works well on myTouch for both portrait and landscape,

new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT,480);

and, this works on Droid for both portrait and landscape,

new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);

Thanks Chris

A: 

My question is what kind of layout params can I use for the VideoView to make sure it plays well in all phones?

Have it fill all available space. VideoView will scale the video to take advantage of whatever room you give it.

CommonsWare
When I have it FILL_PARENT, FILL_PARENT, on landscape mode, it does not scale to full screen. Any ideas?
Chris
@Chris: with only the information you have supplied, not really. Use `hierarchyviewer` to make sure you're getting your `LayoutParams` set properly. Consider using XML for your layouts instead of Java.
CommonsWare