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

前端 未结 8 1306
醉酒成梦
醉酒成梦 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

    If you are using AppCompat, the only way to set the ActionBar icon on devices running Gingerbread (API 10) or below is by setting the android:icon attribute in every Activity in your manifest or setting the drawable programatically.

    
        
            ...
            
            ...
       
    
    

    Update: Be warned however that the application icon will be overridden if you set the android:icon attribute on the launch Activity. The only work around I know of is to have a splash or dummy Activity which then launches your main Activity.

提交回复
热议问题