Reputation: 53
How can i add this icon to my action bar? Is it one of standard?
For example in this item.
<item
android:id="@+id/action_edit"
android:orderInCategory="1"
android:title="Ok"
android:icon="@android:drawable/ic_menu_edit"
android:visible="true"
app:showAsAction="always" />
Upvotes: 2
Views: 674
Reputation: 6392
You can do it via the theme
xml
layout by adding this to your style.xml
file:
<style name="MyTheme" parent="@style/Theme.AppCompat.Light">
<item name="icon">@drawable/actionbar_logo</item>
</style>
Or adding this programmatically inside your activity by adding this:
getSupportActionBar().setLogo(R.drawable.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
Upvotes: 1