2

My Activity extends AppCompatActivity and I can't set the logo the ActionBar. Normally, i do so in the Manifest using "logo" attribute. Doesn't work. in Java in the Activities with getSupportActionBar.setLogo() or setIcon(). Doesn't work.

Could someone help me?

Thx

Andy Strife
  • 729
  • 1
  • 8
  • 27

2 Answers2

7

Try the following:

getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setIcon(R.drawable.ic_launcher);

For more info: https://chris.banes.me/2014/10/17/appcompat-v21/

Musa Y.
  • 1,747
  • 18
  • 26
2

It worked for me

getSupportActionBar().setDisplayShowHomeEnabled(true);

along with

getSupportActionBar().setIcon(R.drawable.ic_launcher);
N J
  • 27,217
  • 13
  • 76
  • 96