0

I want to show a icon button the right side of my actionbar.

This is my menu_drawing 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=".DrawingActivity">


        <item android:id="@+id/action_search"
            android:icon="@drawable/ic_delete_white_36dp"
            android:title="tick"
            android:orderInCategory="0"
            app:showAsAction="always" />
    </menu>

This is my activity

 public class pollActivity extends Activity {
        Button SEND;
        Button CANCEL;

        public boolean onCreateOptionsMenu(Menu menu) {
            MenuInflater inflater = getMenuInflater();

            inflater.inflate(R.menu.menu_drawing, menu);
            return super.onCreateOptionsMenu(menu);
        }
        protected void onCreate(Bundle savedInstanceState) {


            super.onCreate(savedInstanceState);
            setContentView(R.layout.poll_layout);


        }

    }

This is my style

<style name="MyActionBarTheme" parent="android:Widget.Material.Light.ActionBar">
    <item name="android:background">#255e7c</item>
    <item name="android:titleTextStyle">@style/TitleBarTextColor</item>
    <item name="android:homeAsUpIndicator">@mipmap/backbtn</item>
</style>

What is the problem? The icon is not showing and only title appear as "word" on my overflow button?

user2399158
  • 561
  • 3
  • 10
  • 26
  • [http://stackoverflow.com/questions/17585892/change-the-actionbar-homeasupindicator-programamtically](http://stackoverflow.com/questions/17585892/change-the-actionbar-homeasupindicator-programamtically) – M D Mar 29 '16 at 15:33
  • I am not talk about the back button, I am talking about new function button – user2399158 Mar 29 '16 at 15:35
  • Inflate the view for action bar and set button in xml and for details about action bar refer here:- http://coderzpassion.com/android-working-with-material-design/ – Jagjit Singh Mar 29 '16 at 15:51

0 Answers0