Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between SurfaceView and View?

When is it necessary, or better to use a SurfaceView instead of a View?

like image 796
Viktor Avatar asked Aug 07 '09 07:08

Viktor


People also ask

What is a SurfaceView?

Provides a dedicated drawing surface embedded inside of a view hierarchy. You can control the format of this surface and, if you like, its size; the SurfaceView takes care of placing the surface at the correct location on the screen.

How do you pause a surface view?

If you want to 'pause' the thread, you have to use wait() and notifyAll().


1 Answers

Views are all drawn on the same GUI thread which is also used for all user interaction.

So if you need to update GUI rapidly or if the rendering takes too much time and affects user experience then use SurfaceView.

like image 164
Niko Gamulin Avatar answered Sep 22 '22 19:09

Niko Gamulin