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?


I will be gratefull if you can help me.

Thanks in advance,
fortold


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to