fortold wrote: > Hi experts, > > I have a simple problem which makes me feel like a stupid. I really > need help on this. > > I have a SurfaceView which I created with Java code not XML. I created > a MediaPlayer which shows its content on that SurfaceView. > > When I use, > > setContentView(mPreview); // where mPreview is a SurfaceView > > The video is played on the screen. > > I need to add two buttons on the screen. So I tried something like > this: > > LinearLayout layout = new LinearLayout(this); > layout.setOrientation(LinearLayout.VERTICAL); > layout.addView(mPreview); > > Button btn = new Button(this); > btn.setText("test"); > > layout.addView(btn); > > setContentView(layout); > > > This did not change anything. Still the video is displayed on full > screen and no buttons appear. I am a java programmer both SE and ME. > Things are done in this way on Java. > > Does Android have a different approach?
You have not specified the sizes of either the SurfaceView or the Button. Consider using some LinearLayout.LayoutParams to specify sizes. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---