简体   繁体   中英

How to set launcher icon in android in API version greater than 25

How do I generate Android app launcher icon?

My Manifest file of my android app:

<application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">

I am using Android Studio 3.0.1. In mipmap folder I see many file for ic_launcher . Which file to change for the launcher icon?

Android requires different sizes for same icon so that it can automatically check which size is required for which device.

To add custom launcher icon to your app you have to create a icon with different sizes and add your them in mipmap folder.

Now change the icon name in menifiest file for example you add a image named my_appicon.png and your roundedIcon name is my_appicon_round.png then in menifiest file

<application
            android:allowBackup="true"
            android:icon="@mipmap/my_appicon"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/my_appicon_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">

the roundIcon can also be same but if you want to provide round icon for your app you can do this using roundIcon property.

Note: different image sizes are not compulsary android can auto resize your images to different sizes if you don't provide them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM