Action bar app icon missing with Android 5

前端 未结 4 917
面向向阳花
面向向阳花 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:21

    Use the code below in onCreate:

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

提交回复
热议问题