I’ve a custom class whose parent is SurfaceView. I have the class working correctly, drawing to the screen from its own thread etc. However I want to understand how the methods in the question title should be correctly handled.
For example, if my app is running (on a mobile phone) and a call is received, which method is called? Another example is if I implement a dialog box to be displayed if the user ‘long-presses’ on my custom SurfaceView, what method is called then? I assume the canvas is ‘safe’ to write to provided surfaceDestroyed() has not been called.
Basically I want to understand how I should handle eventualities as I’ve described (and possibly more?) and for what events each method is called.
on...-methods are called when something happened.You probably don’t have to implement them because the super class does the correct things in most cases.
If you put log in the methods in question you can see what happens / when they are called. You can also read the API doc and have a look at the source code to see what is done there.