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 trialkristofferfreiholtz2
5,983 PointsHi. 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?
3 Answers
Andrew West
3,245 PointsI'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.
kristofferfreiholtz2
5,983 PointsOk. I used xml to. Just looking for a simpler solution.
artemsborets
4,558 PointsIs there a wizard (similar to eclipse) or layout editor?
Noah Schill
10,020 PointsNoah Schill
10,020 Pointsbump
It would be great if there was something like this in Studio. Is there some type of plugin?