In my android app I am attempting to add a search icon to the action bar as well as add an icon since by default it is not appearing everything I am attempting has yet to work.
I am able to change the title of the AB but not add an icon
getSupportActionBar().setIcon(R.drawable.ic_launcher);
getSupportActionBar().setTitle("geekin radio");
When attempting to add the search box I use the following code
<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="com.geek.MainActivity">
<item android:id="@+id/search"
android:title=""
android:icon="@drawable/ic_action_action_search"
android:showAsAction="always"
android:actionViewClass="android.widget.SearchView" />
</menu>
It still displays the three vertical dots that appear to be settings as opposed to showing my search icon. When I click on the icon it does display a search box though which I think is very odd.
Any ideas?