Amending the code to use the full screen and the best Android class
When you write code for Android, you will always be working within the confines of the operating system. As there are so many variations of Android apps, it makes sense that the Android team would supply lots of different options for us. We will now make a few minor changes so that we are using the most efficient code possible.
When we generated the project, Android Studio built a project that was more ideally suited to a regular app with a conventional user interface. We have already hidden the action bar by modifying the XML. Now we will make a couple of minor code changes in the SubHunter.java
file to use an Android class that is more suited to game development.
Find the following line of code near the top of the SubHunter.java
file:
import androidx.appcompat.app.AppCompatActivity;
Change the preceding line of code to the same as this following line of code:
import android.app.Activity;
Immediately...