简体   繁体   中英

Change Launcher icon on android

How to change launcher icon of android app during run time? I am getting icon from server and want to change it dynamically. In shortcut icon its working but menu icon is not changing.

This may be a duplicate question :

Basically it should be impossible but there is a possible workaround. You can change your manifest to point at multiple drawables.

Create multiple activity-alias tags in Manifest for your MAIN launcher activity and give a different icon drawable to it. You can then choose a particular activity-alias via your code as per your requirement.

Open your android studio as an android application go to res folder inside res folder one folder mipmap. Inside mipmap two folders are showing ic_launcher and ic_launcher_round. Replace with your desired icon of your application and rename your desired icon as ic_launcher.png. Path=Android project>res>mipmap>ic_launcher and ic_launcher_round > put/replace your desired icon in both folder after renaming abc.png to ic_launcher.png and abc.png to ic_launcher_round.png. You can find the location from manifest file from the mentioned line> android:icon="@mipmap/ic_launcher" . Press ctrl+(mouse click) you will reach to same location. Change your desired icon and enjoy.

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