Android: How to change the ActionBar “Home” Icon to be something other than the app icon?

前端 未结 8 1307
醉酒成梦
醉酒成梦 2020-11-28 19:17

My application\'s main icon consists of two parts in one image: a logo and a few letters below it. This works well for the launcher icon for the app, but when the icon appea

8条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 19:42

    Please Try, if use "extends AppCompatActivity" and present actionbar.

     ActionBar eksinbar=getSupportActionBar();
    if (eksinbar != null) {
        eksinbar.setDisplayHomeAsUpEnabled(true);
        eksinbar.setHomeAsUpIndicator(R.mipmap.imagexxx);
    }
    

提交回复
热议问题