开发者

Question about creating a widget under android

I am looking to create an android widget for my application. It is a static widget, meaning it does not periodically update itself with new data (like google search widget)? If that i开发者_如何学JAVAs the case, do I still need to create a service like the Word Widget sample in the android sdk?

Thank you.


No you don't need service. You just build your widget UI in onUpdate. Take a look at samples\android-8\ApiDemos\src\com\example\android\apis\appwidget\ExampleAppWidgetProvider.java

You may need service only if your update logic takes time. If it's fast enough service is not required.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜