Creating the MainActivity menu

In the onCreateOptionsMenu(Menu) function of MainActivity, we inflated a menu that we have not yet implemented. Add a main.xml file in the menu package under the application resource directory. main.xml should contain the following content:

<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"><item  android:id="@+id/action_settings"  android:orderInCategory="100"  android:title="@string/action_settings"  app:showAsAction="never" /><item  android:id="@+id/action_logout"  android:orderInCategory="100"  android:title="@string/action_logout"  app:showAsAction="never" /></menu>

Fantastic work! We are one step closer to finishing ...

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.