Action bar app icon missing with Android 5

前端 未结 4 919
面向向阳花
面向向阳花 2021-02-14 08:59

Just rebuilt my app using the Android 5 SDK and associated appcompat.

Seems to work fine but my app icon is no longer showing in top left hand corner. The icon to open

4条回答
  •  我在风中等你
    2021-02-14 09:22

    Make sure to extend ActionBarActivity rather than Activity. And add the following code:

    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setLogo(R.drawable.ic_launcher);
    getSupportActionBar().setDisplayUseLogoEnabled(true);
    

提交回复
热议问题