How can we change android application icon dynamic

2019-03-27 07:37发布

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.

2条回答
三岁会撩人
2楼-- · 2019-03-27 07:38

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.

查看更多
闹够了就滚
3楼-- · 2019-03-27 07:54

manifest can't be changed dynamically but it trick that you can remove icon app and then add icon you like here is the link : How to change an application icon programmatically in Android?

查看更多
登录 后发表回答