Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Blog Reader Android App Using Intents to Display and Share Posts Easy Sharing with Intents

Hi. Is there a way to get the add new item in menu on android studio? Or do i have to write it directly in the XML file?

Hi. Is there a way to get the add new item in menu on android studio? Or do i have to write it directly in the XML file?

It's done in eclipse in the video but how do i do it in android studio?

Noah Schill
Noah Schill
10,020 Points

bump

It would be great if there was something like this in Studio. Is there some type of plugin?

3 Answers

Andrew West
Andrew West
3,245 Points

I'm also using Android Studio and ended up just adding it to the XML.

The main.xml file in my menu folder looks like this.

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity" >
    <item android:id="@+id/action_logout"
          android:title="@string/logout_menu"
          android:orderInCategory="100"
          android:showAsAction="never" />
</menu>

The stuff in the item tag is declaring a menu item.

Ok. I used xml to. Just looking for a simpler solution.

Is there a wizard (similar to eclipse) or layout editor?