I want to change my application icon color dynamically according to the events such as holi,deepawali.....etc.whether it is possible to change application icon color or not?
Asked
Active
Viewed 1,582 times
0
-
http://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android This will solve your query. – Kushal Mar 30 '15 at 11:37
3 Answers
0
You must first integrate the dynamic color into the application, and then set the background color of the application icon to ?attr/background_color
MainActivity.java
DynamicColors.applyToActivitiesIfAvailable(this.getApplication());
style.xml
<style name="AppTheme" parent="Theme.Material3.DynamicColors.Light">
res/mipmap/your_logo.xml
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="?attr/colorSecondaryContainer" />
<foreground android:drawable="@drawable/logo_foreground" />
</adaptive-icon>
logo_foreground.xml
android:tint="?attr/colorSecondary"
Hope this helps you

Mohamed Rahal
- 61
- 1
- 3
-2
You will have to put an updated version of the app in play store with updated icon during festival.

pvn
- 2,016
- 19
- 33
-
-
Yes you can't change the app icon in any other way since its used by application launcher to display all apps. – pvn Mar 30 '15 at 11:54
-
Please check http://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android .. You can change the app icon – Kushal Mar 30 '15 at 11:57