I won't beat around the bush here... I'm trying to put my
GLSurfaceView (called ShapeSurfaceView) into a relative layout. Before
trying to use a layout, everything has been working fine simply
instantiating the view and calling setContentView(mShapeSurfaceView).
Since I got this error I researched how to create the layout
completing in the Java and that is working quite nicely... it's just a
ton of code to setup the layout, view and rules for the view. I'd
really rather have the XML method working.

Here's the main XML, I've added no other views yet:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<com.maximusdev.tests3d.ShapeSurfaceView
        android:id="@+id/glview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    />
</RelativeLayout>

The java from onCreate, nothing special...

setContentView(R.layout.main);
mShapeSurfaceView = (ShapeSurfaceView)findViewById(R.id.glview);

Here is the logcat error. My previous logcat error was mentioning the
class constructor missing the AttributeSet parameter so I added that
to the constructor for the ShapeSurfaceView yet still ended up with
this.

05-05 18:22:40.327: ERROR/AndroidRuntime(294): Uncaught handler:
thread main exiting due to uncaught exception
05-05 18:22:40.337: ERROR/AndroidRuntime(294):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.maximusdev.tests3d/com.maximusdev.tests3d.My3DTest}:
java.lang.NullPointerException
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2401)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2417)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.app.ActivityThread.access$2100(ActivityThread.java:116)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.os.Handler.dispatchMessage(Handler.java:99)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.os.Looper.loop(Looper.java:123)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.app.ActivityThread.main(ActivityThread.java:4203)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
java.lang.reflect.Method.invokeNative(Native Method)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
java.lang.reflect.Method.invoke(Method.java:521)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
dalvik.system.NativeStart.main(Native Method)
05-05 18:22:40.337: ERROR/AndroidRuntime(294): Caused by:
java.lang.NullPointerException
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
com.maximusdev.tests3d.My3DTest.onCreate(My3DTest.java:30)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2364)
05-05 18:22:40.337: ERROR/AndroidRuntime(294):     ... 11 more

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to