error in getItemId () when creating a menu in the ActionBar

0

I have encountered a problem when creating a menu in the ActionBar, to see if you can help me. To create the menu I am following these tutorials: link and link

I created the first part of the tutorial with menu_main.xml

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity">

    <item
        android:id="@+id/action_acerca"
        android:title="@string/acerca_de"
        android:icon="@drawable/informacion"
        android:orderInCategory="100"
        app:showAsAction="never" />

    <item
        android:id="@+id/action_salir"
        android:title="@string/salir"
        android:icon="@drawable/salir"
        android:orderInCategory="100"
        app:showAsAction="never" />

</menu>

But then with the second tutorial in the MainActivity.java I get an error in getItemId ()

I'm following the same steps to create the menu, and I'm showing error, can someone tell me how to fix it?

Thank you.

    
asked by SoCu 20.12.2017 в 23:37
source

0 answers