Android Studio Menu: Element group is not closed

Viewed 46

First of all, I am still a beginner in programming.

So Im trying to make a grouped menu but it marks the error "Element group is not closed". It basically demands me to close it after the id, which is not what I want.

I am using the same structure as the documentation and the tutorials I have watched so I really don't know what the mistake is.

<group.>

android:id="@+id/example"> Error is in this line

....

<group/.>

Thanks!

2 Answers
<group.>

android:id="@+id/example"> Error is in this line

....

<group/.>

If this is the same code that you currently using in the project. Please remove the ">" at the end of id tag and open an "<item" tag.

<group>
   <item android:id="@+id/example"
         android:title="Some Title"/>
</group>

It seems like your group start and close tags are not correct.

As per the Android documentation:

<group android:id="@+id/group_delete">
        <item android:id="@+id/menu_archive"
              android:title="@string/menu_archive" />
        <item android:id="@+id/menu_delete"
              android:title="@string/menu_delete" />
</group>
Related