0

I have an action bar on the app which looks like this:

enter image description here

Now i am pretty sure , i don't have a default theme on the app but what i was hoping to get buttons instead of the list.Something of this sort.

enter image description here

 <menu xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/action_shuffle"
        android:icon="@mipmap/ic_shuffle_black_18dp"
        android:title="Shuffle"
        app:showAsAction="always"
        android:checkable="true"
        android:checked="false"
        />

    <item
        android:id="@+id/action_end"
        android:icon="@mipmap/ic_close_black_18dp"
        android:title="End"
        app:showAsAction="always" />
</menu>

I have showasaction set to always, it still shows it up as a list.

Manifest looks something like this:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tilak.imusicplay">
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <application
        android:allowBackup="true"
        android:icon="@drawable/playicon"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true">
        <activity android:name="com.example.tilak.imusicplay.MainActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <service android:name="com.example.tilak.imusicplay.MusicService" />
    </application>
</manifest>

Am i missing out something? why doesn't it show up the buttons instead? Like i see in my preview?

Update:

whole code can be uploaded if there is a need?

Community
  • 1
  • 1
Tilak Raj
  • 1,369
  • 5
  • 31
  • 64
  • Possible duplicate of [Item with app:showAsAction not showing](https://stackoverflow.com/questions/26377305/item-with-appshowasaction-not-showing) – Elias Fazel Dec 20 '17 at 00:13

1 Answers1

0

You should set it to

android:showAsAction="always"

Or you must set your theme to AppCompat Check out this Item with app:showAsAction not showing

Elias Fazel
  • 2,093
  • 16
  • 20