Error trying to use XML Layout and extended GLSurfaceView

by Jeremiah Sellars » Thu, 06 May 2010 03:11:17 GMT


Sponsored Links
  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:4



Error trying to use XML Layout and extended GLSurfaceView

by Jeremiah Sellars » Thu, 06 May 2010 04:23:35 GMT


 ot this in the Eclipse console the next time I opened it, searching
for the top error isn't getting me very far...

[2010-05-05 13:13:49 - main.xml] Parser is not a BridgeXmlBlockParser!
java.lang.NullPointerException
at android.view.View.<init>(View.java:1841)
at android.widget.TextView.<init>(TextView.java:326)
at com.android.layoutlib.bridge.MockView.<init>(MockView.java:33)
at android.view.SurfaceView.<init>(SurfaceView.java:45)
at android.view.SurfaceView.<init>(SurfaceView.java:41)
at android.view.SurfaceView.<init>(SurfaceView.java:37)
at android.opengl.GLSurfaceView.<init>(GLSurfaceView.java:189)
at
com.maximusdev.tests3d.ShapeSurfaceView.<init>(ShapeSurfaceView.java:
14)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(Unknown
Source)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:
198)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:
126)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:377)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.onConfigurationChange(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.onTargetChange(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.onDescriptorsChanged(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.initUiRootNode(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor
$1.updateEditor(Unknown Source)
at
com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor
$1.onTargetLoaded(Unknown Source)
at com.android.ide.eclipse.adt.AdtPlugin$16.run(Unknown Source)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:
134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
3855)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench


Sponsored Links


Other Threads

1. What API should I use ? Local Service Binding ? Remote Service Binding ? Handler ?)

Hello,

I am very new beginner, and I am designing a small application as
below.

- After a user starts the application, he/she can click the start
button to start a background task. (e.g. retrieving the news headlines
periodically, then do something...)

- Even after the user quits the application, the background task still
running.

- To stop the background task, the user needs to run the application
again, and clicks the stop button to stop the background task.

In the above scenario, what API should I use ? (Local Service
Binding ? Remote Service Binding ? Handler ?)

Please help me. Thank you very much.

--~--~---------~--~----~------------~-------~--~----~

2. why is my app asking to access phone calls and storage?

I am working on a widget and have it pretty much how I like it, but I
have one problem.  When I package it and install it, it says in the
"allow this application to" portion that it wants access to phone
calls and storage.  I know this will be a no-go if I want anyone to
ever use it.

I have not set up any permissions.  Same thing happens even if I make
Hello World.


Sorry if this has been ask before, but I have searched quite a bit
looking for an answer.

Chris

--~--~---------~--~----~------------~-------~--~----~

3. ADC2 entry app is still being used after closing of Round 1

4. can't get selector to work inside an app widget...

5. Email alerts customization

6. Sending a zip file as email attachment

7. Choose the connection type before sending request