SurfaceView is a view with a surface. It is a sub-class of the class android.view.View. So it is similar to other views, it can receive user input on the screen, it also inherits all view life cycle callback functions.
Android Custom View
android.view.SurfaceView is a sub-class of android.view.View. It is used to create custom views in android game development. It does not have the onDraw method, but you can get and use the android.view.SurfaceHolder object to get and lock the view canvas, and then paint on it. This example will show you how to use it.
When you play a game, you will find the arrow key is a good control method to move the view object on your screen. This example will show you how to use the keyboard arrow key to move the text view on the android screen. It also demonstrates how to make the text move follow …