Bhavik P.
Bhavik P.

Reputation: 915

Toolbar Overflow button onClick startactivity

How can I start new activity on click of the Android toolbar's overflow button click. I don't want the dropdown to appear since I only have one item, rather directly change the activity.

Upvotes: 0

Views: 205

Answers (1)

activesince93
activesince93

Reputation: 1736

Add this line in your menu_item.xml file:

app:showAsAction="always"

menu_item.xml:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/action_github"
        android:title="@string/title_github"
        android:icon="@drawable/ic_github"
        app:showAsAction="always" />
</menu>

Upvotes: 1

Related Questions