Hello there :wave: Was wondering if anyone could ...
# android
o
Hello there 👋 Was wondering if anyone could provide some insight on how we can customize the app launcher icon programmatically? Let's say we allow the user to select from a list of icons in the app on so screen, or allow them to select a color in the app, and then we want to replace the default launcher for our app... Is there a way to do this? Ive read online some different "hacks" but nothing full proof or intentionally supported by Google for this type of customization. Any insights would be much appreciated 🙌
😶 9
g
You cant do it dynamically but your list item is fixed then you have define activity-alias in manifest file equal to no of icon if user open app and user select any icon then you can change launcher icon
Copy code
getPackageManager().setComponentEnabledSetting(
        new ComponentName("com.package.abc", "com.package.abc.MainActivity-Red"), 
            PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
please follow this link for more details how can you do https://www.geeksforgeeks.org/how-to-change-app-icon-of-android-programmatically-in-android/
❤️ 1
o
Thank you!