Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Joseph Karanja169 Points
Camera icon in overflow menu instead of action, even after following all steps
i'm using android studio. Here is my code
<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/menu_camera" android:title="@string/menu_camera_label" android:icon="@drawable/ic_action_camera" app:showAsAction="ifRoom" />
On the "showAsAction" i have tried "Always" and "ifRoom. None of them seem to work."With this, the camera option is in the overflow menu instead of actionbar. Any advise on how to get it on the action bar?
Is your activity extending ActionBarActivity? Also, is your icon stored in the drawables folders or the mipmap folders? Newer versions of Android Studio has a folder called mipmap that most of the icons are referenced from. Which is done via "@mipmap" instead of "@drawable".