Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When is surfaceChanged activated?

Tags:

android

From the developer tutorial, it writes: This is called immediately after any structural changes (format or size) have been made to the surface. You should at this point update the imagery in the surface. This method is always called at least once, after

I do not know what situations refer to strucutral changes. How about screen orientation?

like image 217
user1914692 Avatar asked Jan 07 '13 04:01

user1914692


1 Answers

The method is called when the size of the viewport is changed or first created.

In case of screen rotation from vertical to horizontal, the size of the viewport may change, so you should reset your viewport and projection matrices.

See this blog post for more:

http://android-developers.blogspot.in/2009/04/introducing-glsurfaceview.html

like image 103
Anup Cowkur Avatar answered Oct 16 '22 18:10

Anup Cowkur