[android-developers] GLSurfaceView onPause/OnResume, transparent Activities on top

2011-03-17 Thread George
I have a GLSurfaceView in my Activity and call onPause/onResume when
my Activity is paused or resumed respectively.

When I launch an opaque Activity on top of my GLsurfaceView calling
onPause/onResume seems reasonable, but suppose I launch a transparent
Activity on top on my GLSurfaceView, I don't want to call onPause
because I want any animations running to be seen. Also since onPause
deletes the context, reconstructing onResume may cause visual
artifacts like textures going from blank (since they got cleaned up)
to actual texture.

It is ok to call GLSurfaceview.onPause/onresume in onStop and
onRestart, since we are guaranteed that in onStop that the
GLSurfaceView won't be "visible"?

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


[android-developers] GLSurfaceView onPause/onResume

2010-07-09 Thread Alimae
Hi,

I have an app wich is is a TabActivity with 3 tabs.
Each tab is an activity.

The first tab (Activity1) has a FrameLayout which contains a
GLSurfaceView. All the GL code is done in my native library (using the
ndk)/
I have put logs into the onSurfaceDestroyed (in GLSurfaceView) and the
onSurfaceCreated (in the renderer of the GLSurfaceView) methods to
know when they are called

I launch the app, the first tab (Activity1) is displayed, my GL stuff
works fine.
I switch to the second tab, Activity1 receives the onPause event, so i
call the GLSurfaceView.onPause to pause the glThread. That's works.

I 'm in the second tab, i re-switch in the first tab. Activity1
receives the onResume event, so i call the GLSurfaceView.onResume but
i see in my logs that onSurfaceCreated is called  and i have never
seen "onSurfaceDestroyed" in logs ...

If I don't call the GLSurfaceView.onPause/onResume, the switch/re-
switch works but onDrawFrame is always called.
Of course, i can use a boolean to draw nothing when the activity is
paused but the onDrawFrame is always called and official doc
recommends to call the GLSurfaceView.onPause/onResume methods.

Any ideas about that?

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