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 Self-Destructing Message Android App Capturing Photos and Videos Adding a Camera Button in the Action Bar

Raghda Talaa't
Raghda Talaa't
2,944 Points

Overflow menu is not showing in my S3 device

When i tested it on the emulator it shows the three dots for the overflow menu and the camera icon but on my device it shows only the camera icon, why?

2 Answers

My galaxy note 3 acts in the same way. Im pretty sure thats because you got the options button down to the left of your homebutton. When you thouch it the overflow menu will show on the screen. I guess it implemented in the background so it doenst show on devices that have a "real hardware" options button.

Heres a picture of the button i found on the web. http://cdn.webcazine.com/wp-content/uploads/2012/06/samsung_galaxy_s3_option_keys1.jpg?00d8d4

just paste this code to your menu_main.xml. by the way, maybe you have to change some item ids. it works for me. just try that and let me know. happy coding

'''xml

<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_camera" android:icon="@drawable/ic_action_camera" android:orderInCategory="100" android:title="@string/menu_camera_label" app:showAsAction="always"/>

<item
    android:icon="@android:drawable/ic_menu_sort_by_size"
    android:id="@+id/menu_overflow"
    android:orderInCategory="11111"
    app:showAsAction="always">
    <menu>

        <item
            android:id="@+id/log_out"
            android:orderInCategory="100"
            android:title="@string/menu_log_out"
            app:showAsAction="never"/>

        <item
            android:id="@+id/action_edit_friends"
            android:orderInCategory="100"
            android:title="@string/menu_edit_friends"
            app:showAsAction="never"/>

    </menu>
</item>

</menu>

'''