开发者

Android application icon changes with runtime

In my app I want to display different icons for the application. Changes should be according to the scenario. For example, it will mark the numbe开发者_开发知识库r of days remaining for the task completion. On the android menu this icon will display the number of days remaining. If anyone has any idea for this, I would appreciate it. Thanks.


There are actually a number of ways to achieve this. If you notice Google's clock app these days, it does show the current time.

You can refer to this tutorial: https://blog.jakelee.co.uk/programmatically-changing-app-icon/

Or find even more ways here: How to change an application icon programmatically in Android?


As far as i know, you cant. Also refer to this answer:

Android Application Icon Change


I am afraid you can't change your app's icon programmatically. How to change an application icon programmatically in Android?


This can be done easily. Within your activity code, just write:

getActionBar().setIcon(R.drawable.new_icon);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜