Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App icon is not visible on Actionbar in android Lollipop and above

I just migrate from api 19 Kitkat to api 21 Lollipop. And now I have found that the app icon is not there on actionbar. I feel that my app looks kind of different. So is there any way to show the app icon.

like image 855
Biswajit Avatar asked Dec 18 '14 05:12

Biswajit


People also ask

How to add icons in ActionBar Android?

To generate ActionBar icons, be sure to use the Asset Studio in Android Studio. To create a new Android icon set, right click on a res/drawable folder and invoke New -> Image Asset.

Where is the action overflow icon located?

The right-hand side of the action bar shows the actions. The action buttons (3) show the most important actions of your app. Actions that do not fit in the action bar are moved to the action overflow, and an overflow icon appears on the right.

What is action overflow icon on phone?

The action overflow in the action bar provides access to your app's less frequently used actions. The overflow icon only appears on phones that have no menu hardware keys. Phones with menu keys display the action overflow when the user presses the key. Action overflow is pinned to the right side.


2 Answers

In the Material theme (and AppCompat version 21 which is based on it), the Action Bar follows the material design guidelines and uses a Toolbar:

  • A title and subtitle. The title should be a signpost for the Toolbar's current position in the navigation hierarchy and the content contained there. The subtitle, if present should indicate any extended information about the current content. If an app uses a logo image it should strongly consider omitting a title and subtitle.

In modern Android UIs developers should lean more on a visually distinct color scheme for toolbars than on their application icon. The use of application icon plus title as a standard layout is discouraged on API 21 devices and newer.

However, if you want an application icon, setLogo() is the correct method.

like image 156
ianhanniballake Avatar answered Sep 21 '22 01:09

ianhanniballake


I would also like to show my awesome app icon in Lollipop+, so here's what I used.

mActionBar.setDisplayShowHomeEnabled(true);
mActionBar.setIcon(Drawable); // Or drawable resource id.

Source: ActionBar#setDisplayShowHomeEnabled(boolean)

like image 35
Anonsage Avatar answered Sep 21 '22 01:09

Anonsage