So I've spent about two days trying to get a working SurfaceView. Tutorials I am following online aren't working even when followed to the letter. I normally get an entirely black screen.
In order to help teach myself how it works I need a working SurfaceView program.
I'm looking for a program that has the SurfaceView generated in a separate class. I would be very grateful if someone is able to post full code (XML and Java) for a SurfaceView program that simply turns the entire screen Red or White.
Thank you for any help!
(Any explanations along with the code would be amazing!)
Try this link
Ansroid SurfaceView Example
I followed this tutorial example. It works fine.
Edit
Simple Code for
SurfaceViewLayout xml
Java Activity Code
Edit2
If you use custom SurfaceView xml will be like this..
Code inside Activity