Locking the game to fullscreen and landscape orientation
As with the previous projects, we want to use every pixel that the device has to offer, so we will make changes to the AndroidManifest.xml
file that allow us to use a style for our app that hides all the default menus and titles from the user interface.
Make sure the AndroidManifest.xml
file is open in the editor window.
In the AndroidManifest.xml
file, locate the following line of code: android:name=".SnakeActivity">
.
Place the cursor before the closing >
shown previously. Tap the Enter key a couple of times to move the >
a couple of lines below the rest of the line shown previously.
Immediately below ".SnakeActivity"
but before the newly positioned >
, type or copy and paste this next line of code to make the game run without any user interface:
android:theme= "@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"
Your code should look...