I fixed this problem by redesigning the app and using only one
GLSurfaceView with just one Renderer.

On Aug 26, 7:09 pm, MobileVisuals <[email protected]> wrote:
> I think the reason for my problems is that I use 10 GLSurfaceViews,
> each with their own renderer. This means that 10 renderers and 10 3d
> threads are started at the beginning of the app.
>
> I tried to redesign the app with just one GLSurfaceView. The idea was
> to reload the GLSurfaceView with findViewById(R.id.glview) and then
> call setRenderer
> everytime a new 3d visual is shown. It is only possible to call
> setRenderer one time in the life cycle of a  GLSurfaceView. So I
> called invalidate on the GLSurfaceView and set it to null, after using
> it. I still got
> "java.lang.IllegalStateException: setRenderer has already been called
> for this instance."
> the next time I tried to load a GLSurfaceView and set a renderer. This
> is strange, because I set the instance to null. Is there some way to
> avoid this? Or maybe this is not a good approach?
>
> Is the best approach to have one GLSurfaceView with just one Renderer
> instead of one GLSurfaceView with 10 different renderers?
>
> On Aug 25, 3:01 pm, MobileVisuals <[email protected]> wrote:
>
> > Yes, there is one activity for the 2d GUI, which is implemented with
> > SurfaceView. That GUI has a list with 10 3d visuals, that you can
> > choose to view. When you choose to view a 3d visual, a GLSurfaceView
> > is shown. You can then go back to the 2d menu. You can then choose
> > another 3d visual. Another GLSurfaceView is then shown. You can then
> > go back to the 2d menu and so on... This usually works but the
> > GLSurfaceView freezes for a few seconds in about 10% of the cases,
> > where the user wants to go back to the 2d menu.
>
> > On Aug 25, 12:38 pm, RichardC <[email protected]> wrote:
>
> > > In your original post did you actually mean 10 (ten) GLSurfaceViews in
> > > one activity?
>
> > > On Aug 25, 10:05 am, MobileVisuals <[email protected]> wrote:
>
> > > > I debugged this on Logcat and got the following messages, when it
> > > > switched from GLSurfaceView to SurfaceView, but freezed:
>
> > > > handle 0x494900 still locked (state=40000001)
> > > > WARN/WindowManager(53): No window to dispatch pointer action 1
> > > > WARN/InputManagerService(53): Window already focused, ignoring focus
> > > > gain of: com.android.internal.view.IInputMethodClient$Stub
> > > > $Proxy@43d3c260
>
> > > > Does anyone know how I can avoid this?
>
> > > > On Aug 24, 9:54 pm, MobileVisuals <[email protected]> wrote:
>
> > > > > My app switches between a SurfaceView and 10 GLSurfaceViews. It can
> > > > > swith to the GLSurfaceViews without problem, but sometimes the
> > > > > displayed GLSurfaceView freezes when I try to switch back to the
> > > > > SurfaceView,
> > > > > I assume this is a threading issue.
>
> > > > > I used suspend() and resume() to control the  SurfaceView before, but
> > > > > then I read this can result in deadlocks. So I changed it to
> > > > > yield(),but the problem remained. I use onResume() and onPause to
> > > > > control the GLSurfaceViews. I can't find any yield method that I can
> > > > > use for the GLSurfaceView thread. Is there a better way to control the
> > > > > GLSurfaceView? Can onResume() and onPause result in deadlocks?

-- 
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