开发者

Updating the launcher icon at run-time

开发者 https://www.devze.com 2022-12-22 10:12 出处:网络
Is it possible to update the launcher icon dynamically? Currently it seems that it can only be set statically at build开发者_如何学运维 time using the android:icon attribute in the AndroidManifest.xml

Is it possible to update the launcher icon dynamically? Currently it seems that it can only be set statically at build开发者_如何学运维 time using the android:icon attribute in the AndroidManifest.xml file. For example, to display a unique icon based on the device's location?

Is this something that can be achieved using aliases? If so, can an alias's launcher icon be enabled/disabled dynamically?


You should use a home widget for such things.


This needs to be initiated by the user though (since it appears that an application cannot add a widget to the home screen - http://groups.google.com/group/android-developers/browse_thread/thread/3e98e918c2bb8580).

Is there another way which allows the application to control the image displayed by the launcher icon without user intervention?


There is a way. You can specify a specific Image/Icon to display based on the phone's provider and the location. Read this online documentation: http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

0

精彩评论

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

关注公众号