Find glsurfaceview in UnityPlayer.currentActivity

Ok, I’ve searched around the forums and tested a hundred different things and I just cannot find how to access the glsurfaceview that Unity uses.

I am trying to get a reference to the surfaceholder so I can use the HTC sdk to execute some GL native calls from a plugin. So far I have the plugin ready and working, however I need to get access to the glsurfaceview without knowing its id.

I have tried findViewByID(android.r.id.content) which is a FrameLayout with just one children which is a UnityPlayer again… I have tried getDecorView on the UnityPlayer.currentActivity which ends up pointing to the same FrameLayout.
I have tried but failed miserably trying to loop through the Resources collection in the currentActivity (getResources()).
I have tried to find it by name through getResources() with no luck as I don’t know how Unity calls the glsurfaceview when it creates it.

Any help will be very appreciated, I am sure there is a way to do this as I’ve seen a demo that does it, but I don’t have access to the source code.

Oh by the way, I migrated to Android development three weeks ago and this is my first attempt to build a Plugin, I hope for my own sanity that this is not a really easy thing to do that you learn in chapter 1.

Thanks!

Any answer on this? I’m having real tough time figuring out the same thing…

I also would be really thankfull if someone could shed some light on this.