O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Options menu

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:

@drawable/ic_settings_black

Usually, icons can be generated using Android Studio with File||New||Image Asset.  ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required