Adding View extending from SurfaceView to layout gives me a blank screen

Posted by JonF on Stack Overflow See other posts from Stack Overflow or by JonF
Published on 2010-06-05T21:41:29Z Indexed on 2010/06/05 21:52 UTC
Read the original article Hit count: 977

Filed under:
|

I'm very new to Android programming, so this is probably something pretty basic. I just have an xml layout with a few buttons. I'm trying to follow the model given by the JetBoy demo, so I'm adding a view to the layout which extends SurfaceView. When this new view is put in my xml layout, I just get a blank screen.

Here's the XML layout if it helps. The gameview element is what causes the screen to be blank

<?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"
    android:alwaysDrawnWithCache="true">
 <game.test.gameEngine
      android:id="@+id/gameView"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"/>
<Button android:text="Easy" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/EasyButton"></Button>
<Button android:text="Medium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/MedButton"></Button>
<Button android:text="Hard" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/HardButton"></Button>
<DatePicker android:id="@+id/DatePicker01" android:layout_width="wrap_content" android:layout_height="wrap_content"></DatePicker><Button android:id="@+id/Button04" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Exit"></Button>


</LinearLayout>

© Stack Overflow or respective owner

Related posts about android

Related posts about surfaceview