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.
2 Answers
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 yourMAIN
launcher activity and give a different icondrawable
to it. You can then choose a particularactivity-alias
via your code as per your requirement.

- 109
- 1
- 2
- 10
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.

- 657
- 6
- 16