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

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

    creating logo

    in folders "drawable-..." create in all of them logo.png . The location of the folders: [YOUR APP]\app\src\main\res

    In AndroidManifest.xml add line: android:logo="@drawable/logo"

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:logo="@drawable/logo"
        ...
    

    that's it.

    0 讨论(0)
  • 2020-11-28 19:48

    Please try this line

    getSupportActionBar().setHomeAsUpIndicator(R.drawable.back_arrow);
    
    0 讨论(0)
提交回复
热议问题