博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
2.App Components-App Widgets
阅读量:4509 次
发布时间:2019-06-08

本文共 1468 字,大约阅读时间需要 4 分钟。

1. App Widgets

  App Widgets are miniature application views that can be embedded in other applications (such as the Home screen) and receive periodic

    updates. These views are referred to as Widgets in the user interface, and you can publish one with an App Widget provider. An

    application component that is able to hold other App Widgets is called an App Widget host. The screenshot below shows the Music

    App Widget.

    

2. The Basics

  To create an App Widgets, you need the following:

  <1> AppWidgetProviderInfo object

    Describes the metadata for an App Widget, such as the App Widget's layout, update frequency, and the AppWidgetProvider class.

      This should be defined in XML

  <2> AppWidgetProvider class implementation

    Defines the basic methods that allow you to programmatically interface with the App Widget, based on broadcast events. Through it,

      you will receive broadcasts when the App Widget is updated, enabled, disabled and deleted

  <3> View Layout

    Defines the initial layout for the App Widget, defined in XML.

 

3. Declaring an App Widget in the Manifest

//specifies the AppWidgetProvider used by the App Widget
//specifies that the AppWidgetProvider accepts the                                              //ACTION_APPWIDGET_UPDATE broadcast
//specifies the AppWidgetProviderInfo resource location

 

转载于:https://www.cnblogs.com/iMirror/p/4065813.html

你可能感兴趣的文章
设计模式之——单例模式
查看>>
Linux下vim上编辑实现进度条
查看>>
ubuntu 设置plank开机自启之后关机键失效变为注销键
查看>>
JS--我发现,原来你是这样的JS(三)(基础概念--灵魂篇)
查看>>
手指滑动切换手机图片
查看>>
解决Oracle EM无法启动
查看>>
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
查看>>
PHP 跨域资源共享 CORS 设定
查看>>
男神鹏:使用Redis 的一些 问题解决方案。
查看>>
创建空间参考
查看>>
TestFlight下载app 初使用
查看>>
promise学习
查看>>
在vagrant官网下载各种最新.box资源
查看>>
selenium+python自动化95-弹出框死活定位不到
查看>>
关于防止用户表单多次提交方案的思考
查看>>
MAC终端显示tree命令
查看>>
Dissecting the First C# Program "HelloWorld"
查看>>
多线程--生产者消费者--简单例子
查看>>
Mac 安装tensorflow
查看>>
jsoup html解析器 实现对博客园博文标题链接抓取
查看>>