I have a SurfaceView and a GLSurfaceView inside a FrameLayout.
The first SurfaceView is used for camera preview, and the
GlSurfaceView is for drawing 3D objects that are supposed to be on top
of the camera preview.
So natually, I compose the xml like this:
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/mainFrame">
<SurfaceView android:id="@+id/camSurface"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<android.opengl.GLSurfaceView android:id="@+id/glSurface"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
... ...
Unfortunetly, this doesn't work. 3D objects can not be seen.
I found later that it only works when the order of the 2 views is
reversed, which means:
<android.opengl.GLSurfaceView android:id="@+id/glSurface"...
<SurfaceView android:id="@+id/camSurface"...
The reversed ui works fine, for a while...
Everything is OK when the app has a fresh start. But when I press home
to go back to the desktop and then click on the icon again to resume
the app, 3D objects are gone.
Then I reverse the ui again, like before, no 3D objects. But when I
press home and then resume the app, they appeared!
My conclusions are:
The order of the 2 surface view are wrong in the fresh start, but when
the app is resumed from another task, they are set back to their
normal order.
Is this a bug? Anyone experience the same problem?
I'm running CM 4.2.5 rom with 1.6 firmware on a HTC G2.
--
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