Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we change android application icon dynamically in Android [duplicate]

I know that same kind of question has been asked for activity icon, but my question is little bit different.

I just wanted to know whether we can set the application icon programmatically, I am not asking to change, I am just asking for setting it. I hope I am clear.

<application android:icon="drawable resource"> </application>

In the above example I am setting it in manifest file, but instead of manifest can I set it through java code.

like image 821
user1102123 Avatar asked Jan 14 '14 08:01

user1102123


People also ask

Can I change app icon dynamically in Android?

In this article, we are going to learn how to change the App Icon of an App on the Button Click. This feature can be used when we have an app for different types of users. Then as per the user type, we can change the App Icon Dynamically.

How do I change the icon on my clone app?

Just select the icon pack and App Cloner will find the correct icon (provided the icon pack contains an icon for the app in question). Also, in the App Cloner settings you can set a default/preferred icon pack. Then all cloning will try to use the app icon from the selected icon pack by default.


1 Answers

As you can read here http://developer.android.com/guide/topics/manifest/manifest-intro.html the default's app icon is set in the manifest. As manifest is located in the app's /root it cannot be modified, so there's no way to do it. You may consider that if you could change it while the app is running, changes wouldn't be saved in the manifest.

like image 83
pabloFdz Avatar answered Nov 15 '22 16:11

pabloFdz