http://groups.google.com/group/android-developers/browse_thread/thread/9c335071c7919d80/827167f6a3dc08ee#827167f6a3dc08ee

Same issue, I resolved it by calling finish() when the onPause()
function gets called (ie when home is pressed). This totally stops the
activity, and then next time it starts, it starts fresh, with opengl
surface first, then camera preview surface.  I also block the search
button.

I noticed in Layar, when you hit the search button, and then back out
of search, the opengl disappears.  We aren't alone :)  You can see my
app on
youtube http://www.youtube.com/watch?v=PbbZzLkz4gc

Hope this helps.

On Dec 16, 8:30 am, mianwo <[email protected]> wrote:
> 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

Reply via email to