简体   繁体   English

Android:在更新时间之前在运行时更改应用小部件的文本!

[英]Android: change app widget's text on runtime before update time!

someone please tell me how can I update the TextView that is on app Widget, before default update period time is come.?.?.?.(30,om, or 1h... I set on 30mins but It updates on 1h) 有人请告诉我如何更新应用程序小工具上的TextView,在默认更新周期到来之前。?。?。。。(30,或1小时...我设置30分钟,但它在1小时更新)

So I have an activity which decides what is the final text on the widget, and it may be changed by user in the runtime, so after user changes something I should be able to show the final changes on widget (immediately),but I can't. 所以我有一个活动来决定小部件上的最终文本是什么,它可能会被用户在运行时更改,所以在用户更改之后我应该能够在小部件上显示最终的更改(立即),但我可以“T。 how can I achieve this? 我该怎么做到这一点?

many thanks guys. 非常感谢你们。

how can I achieve this? 我该怎么做到这一点?

Just update the app widget via an AppWidgetManager . 只需通过AppWidgetManager更新app小部件即可。 There is nothing magic about the "update time" -- you can update your app widget at any point. “更新时间”没有什么魔力-您可以随时更新应用程序小部件。 Construct your RemoteViews , configure them, and use the AppWidgetManager to push over the change to the home screen. 构造RemoteViews ,对其进行配置,然后使用AppWidgetManager将更改推到主屏幕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM