Finally, we need to make the SettingsActivity available from the MainActivity. As we said before, we will use the options menu on the MainActivty for this.
First of all, let's create a menu.xml file under the app/src/main/res/menu directory. The structure of the menu will be set to the following:
<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/settings" android:icon="@drawable/ic_settings_black" android:title="Settings" /></menu>
This means that there will be just a single menu entry named settings. Also, we have added an icon for the entry:
Usually, icons can be generated using Android Studio with File||New||Image Asset. ...