应用程序启动器图标,显示更新可用 [英] Application launcher Icon to show update is available

查看:118
本文介绍了应用程序启动器图标,显示更新可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的应用程序有我想要的应用程序启动器图标应该通知其提供的任何更新。否则默认的启动器图标就会出现。

If My App has any updates available I want the Application Launcher icon should notify it. Otherwise the default launcher icon will appear.

我看到的三星应用在它的启动器图标应用程序更新的数量。

I saw Samsung Apps has number of App updates on its Launcher Icon.

我在我的服务器上运行的Web服务要知道更新是否可用。

I have web services running in my server to know whether the update is available.

任何帮助将是令人钦佩的。

Any help will be admirable.

推荐答案

您也许可以设计自己的图标为具有两种状态的切换:updates_available,或正常。你将不得不创建自定义状态,并且覆盖发射活动的处理设置图标的方法。然后,你就必须写一个持续的服务,定期检查更新和广播来发射....但是这需要你建立你自己的发射..这我假设是不是一种选择。

You could probably design your icon as a selector that has two states: updates_available, or normal. You would have to create the custom state and override the method in the launcher activity that handles setting the icon. Then, you would have to write a persistent service that periodically checks for updates and broadcasts to the launcher.... but this would require you build your own launcher.. which I'm assuming is not an option.

但是有两种方法可以做到这一点,这将产生类似的结果:

But there are two ways to do this which will yield a similar result:

1:创建一个1x1的控件,它仅仅是一个启动的preSS您的活动图像视图。这个小工具将接受您的更新检查服务广播并相应地改变自己的形象。这是非常相似的,你会想要做上述的方法

1: Create a 1x1 widget which is simply an image view that launches your activity on press. This widget will accept broadcasts from your update checking service and change its image accordingly. This is very similar to the way you would "want" to do it mentioned above.

2:将您的应用程序添加快捷方式如下所述:
 <一href=\"http://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android\">How在Android的编程方式更改应用程序图标?

2: Have your application add a shortcut as described here: How to change an application icon programmatically in Android?

这篇关于应用程序启动器图标,显示更新可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆