Trouble with GLSurfaceView (more info: works if only view, but not as one of several)

by SChaser » Sun, 13 Sep 2009 06:30:41 GMT


Sponsored Links
 More information:

It works if it is the ONLY view on the page, as done by

_surfaceView = new GLSurfaceView(this);
setContentView(_surfaceView);

However, if I make it part of the app framework, it fails as described
above in this discussion:
setContentView(R.layout.main);
_surfaceView = (GLSurfaceView)this.findViewById(R.id.SurfaceView);

See below for main.xml

Odd, eh?

Thanks in advance

---------------------- main.xml ----------------------
<?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">
  <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Put text here" />
  <LinearLayout
    android:id="@+id/LinearLayout01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    <Button
      android:text="Solid"
      android:id="@+id/SolidWireButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"></Button>
    <Button
      android:text="Sphere"
      android:id="@+id/SphereButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"></Button>
    <Button
      android:text="Cube"
      android:id="@+id/CubeButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"></Button>

  </LinearLayout>
  <android.opengl.GLSurfaceView
    android:id="@+id/SurfaceView"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"></android.opengl.GLSurfaceView>
</LinearLayout>



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



Other Threads

1. Update to 0.9.9 causing a little misery :).

 Anyone know why I would be getting the errors below. The message below 
is showing up in the Console view, and I'm getting a "Conversion to 
Dalvik format failed with error 1".


My app has been working quite well for some time, and I just tried to update the SDK and DDMS to 0.9.9, and now it won't build. I've done a search for the CharBuffer class and don't find any matches in my files, but I am using several API's (BUMP, C2DM, Admob). I definitely don't use any of the core-library in my code. If the error message is correct, I just can't quite figure out how to tell which API is the problem without almost wiping out my code base, or starting a new project and copying a few files at a time. Oh... but the two files at the bottom of the file are missing android-6\sdk.properties and android-5\sdk.properties. Anyone know where I find them? I have tried uninstalling and reinstalling but so far, no joy :). [2010-09-24 00:54:43 - HotTonight] trouble processing "java/nio/CharBuffer.class": [2010-09-24 00:54:43 - HotTonight] Attempt to include a core class (java.* or javax.*) in something other than a core library. It is likely that you have attempted to include in an application the core library (or a part thereof) from a desktop virtual machine. This will most assuredly not work. At a minimum, it jeopardizes the compatibility of your app with future versions of the platform. It is also often of questionable legality. If you really intend to build a core library -- which is only appropriate as part of creating a full virtual machine distribution, as opposed to compiling an application -- then use the "--core-library" option to suppress this error message. If you go ahead and use "--core-library" but are in fact building an application, then be forewarned that your application will still fail to build or run, at some point. Please be prepared for angry customers who find, for example, that your application ceases to function once they upgrade their operating system. You will be to blame for this problem. If you are legitimately using some code that happens to be in a core package, then the easiest safe alternative you have is to repackage that code. That is, move the classes in question into your own package namespace. This means that they will never be in conflict with core system classes. If you find that you cannot do this, then that is an indication that the path you are on will ultimately lead to pain, suffering, grief, and lamentation. [2010-09-24 00:54:43 - HotTonight] 1 error; aborting [2010-09-24 00:54:43 - HotTonight] Conversion to Dalvik format failed with error 1 [2010-09-24 00:54:47 - SDK Manager] Warning: Error parsing 'C:\Program Files\Android\SDK\platforms\android-5\sdk.properties': java.io.FileNotFoundException: C:\Program Files\Android\SDK\platforms\android-5\sdk.properties (The system cannot find the file specified). [2010-09-24 00:54:47 - SDK Manager] Warning: Error parsing 'C:\Program Files\Android\SDK\platforms\android-6\sdk.properties': java.io.FileNotFoundException: C:\Program Files\Android\SDK\platforms\android-6\sdk.properties (The system cannot find the file specified). [2010-09-24 00:58:16 - SDK Manager] Warning: Error parsing 'C:\Program Files\Android\SDK\platforms\android-5\sdk.properties': java.io.FileNotFoundException: C:\Program Files\Android\SDK\platforms\android-5\sdk.properties (The system cannot find the file specified). [2010-09-24 00:58:16 - SDK Manager] Warning: Error parsing 'C:\Program Files\Android\SDK\platforms\android-6\sdk.properties': java.io.FileNotFoundException: C:\Program Files\Android\SDK\platforms\android-6\sdk.properties (The system cannot find the file specified). -- Sincerely, Brad Gies ----------------------------------------------------------------------- Bistro Bot - Bistro Blurb http://bgies.com http://bistroblurb.com http://ihottonight.com http://forcethetruth.com ----------------------------------------------------------------------- Everything in moderation, including abstinence Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead --

2. Image Zomming using finger touch.

Hi All

I need to implement the Image zoom in and zoom out functionality using the
finger touch,like we have it in Android  phone Image gallery,
Please let me know how can i do this in my app.Does any had done this
before.

Please help.

-- 
Thanks and Regards
Ajmer Singh

-- 

3. Capturing / saving a download link

4. HTC Wildfire didn't find my app on the market

5. Tool/Tab Bar at bottom with HTC Sense-like UI?

6. Increase Internet speed by 20%

7. Cannot select rows from a ListView which contains Button controls