Adding a menu

Let's start by creating the menu resource file. Right-click the res directory, and select New | Android resource file. Enter to_do_list_menu as the File name. Change the Resource type to Menu, and click OK, as shown in the following screenshot:

Replace the code in the to_do_list_menu,xml file with the lines of code shown as following:

<?xml version="1.0" encoding="utf-8"?><menu xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:android="http://schemas.android.com/apk/res/android">    <item        android:id="@+id/edit_item"        android:title="@string/edit"        android:icon="@android:drawable/ic_menu_edit"        android:visible="false"        app:showAsAction= ...

Get Learning Kotlin by building Android Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.