开发者

Android application icon changes with runtime

开发者 https://www.devze.com 2023-03-07 04:16 出处:网络
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 compl

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

精彩评论

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