0

Here is my menu file:

<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=".PrepareGroups">
    <item
        android:id="@+id/action_submit"
        android:icon="@drawable/ic_action_send_now"
        android:orderInCategory="100"
        android:title="@string/accept"
        app:showAsAction="always" />
</menu>

My Class signature:

public class PrepareGroups extends AppCompatActivity

Here is the xml layout of my Activity:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:custom="http://schemas.android.com/tools"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/MyAppbar"
        android:layout_width="match_parent"
        android:layout_height="256dp"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapse_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/color_white"
            android:fitsSystemWindows="true"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center">


                <RelativeLayout
                    android:layout_width="120dp"
                    android:layout_height="120dp">

                    <com.wang.avi.AVLoadingIndicatorView
                        android:id="@+id/progressBar"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_centerInParent="true"
                        android:visibility="invisible"
                        app:indicator="BallScaleMultiple"
                        app:indicator_color="@color/colorAccent" />


                </RelativeLayout>

                <com.github.lzyzsd.circleprogress.DonutProgress
                    android:id="@+id/donut_progress"
                    android:layout_width="120dp"
                    android:layout_height="120dp"
                    android:visibility="invisible"
                    app:donut_finished_stroke_width="2dp"
                    app:donut_inner_bottom_text_color="@color/color_white"
                    app:donut_text_color="@color/color_white"
                    app:donut_unfinished_stroke_width="5dp"
                    custom:donut_progress="30" />


            </RelativeLayout>

            <android.support.v7.widget.Toolbar
                android:id="@+id/MyToolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin" />


        </android.support.design.widget.CollapsingToolbarLayout>

    </android.support.design.widget.AppBarLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="fill_vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

    </android.support.v7.widget.RecyclerView>

</android.support.design.widget.CoordinatorLayout>

I am explicitly defining: app:showAsAction="always"

However each time I get the overflow menu with three dots - which I dont want. What do I miss here?

User3
  • 2,465
  • 8
  • 41
  • 84

2 Answers2

0

Try this:-

android:showAsAction="ifRoom"

Sabari
  • 1,963
  • 1
  • 13
  • 10
  • I think app namespace would be more appropriate here - I get the desired result with android:showAsAction. – User3 Feb 03 '16 at 13:20
0

Use Toolbar code like this. It may helps you.

            <android.support.v7.widget.Toolbar
            android:id="@+id/MyToolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin" />