I've been looking on google on how to do this, from what I've gathered it's not as easy as 123 because the surface view will just draw above it, the solution which people have said is to use an xml layout and make a layout and then add the surface view as a child and the button as a child to that. However I'm completely lost on this I'd really love to see some code on how to do this (I prefer looking at examples and trial and error for learning).
My xml file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/Menu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Menu" />
<Android.Game.GameView
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</FrameLayout>
</LinearLayout>
I've got no code for adding in the button except for what you see on the xml (I've been doing a lot of trial and error).
project works like this: activity --> setContentView(surface view) --> render the gfx on the onDraw
Can someone please help me with this, once I've seen an example on how to do this with 1 object I'll be able to do it with other objects.
EDIT - solved it o.k I've managed to work it out from this post http://www.mail-archive.com/android-beginners@googlegroups.com/msg11780.html
I had to set the content view to the xml file, and add some constructs to the surface view so it would work