The application icon does not show on action bar

You are using the AppCompat version 21+ and it is normal.

The Action Bar follows the material design guidelines and uses a Toolbar.
As you can read here:

The use of application icon plus title as a standard layout is
discouraged on API 21 devices and newer.

If you would like an application icon (but I discourage it), you can use the method setLogo().

Something like this:

ActionBar actionBar = getSupportActionBar();
actionBar.setLogo(R.drawable.my_logo);
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);

Leave a Comment