加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Application Components(应用的构成)

发布时间:2020-12-12 20:39:51 所属栏目:百科 来源:网络整理
导读:A view hierarchy is placed within an activity's window by the Activity.setContentView() method. The content view is the View object at the root of the hierarchy. (See the separate User Interface document for more information on views and t

A view hierarchy is placed within an activity's window by the Activity.setContentView() method. The content view is the View object at the root of the hierarchy. (See the separate User Interface document for more information on views and the hierarchy.)

The content view is the View object at the root of the hierarchy. 这句话如果是真的,比较重要。

Broadcast receivers do not display a user interface. However,they may start an activity in response to the information they receive,or they may use the NotificationManager to alert the user.

Notifications can get the user's attention in various ways — flashing the backlight,vibrating the device,playing a sound,and so on. They typically place a persistent icon in the status bar,which users can open to get the message.

收到消息有可能会用NotificationManager 去通知、提示使用者,或者像之前用的toast也可以。NotificationManager 可以有很多提示使用者的方法,看上面可以知道。

Content providers A content provider makes a specific set of the application's data available to other applications. The data can be stored in the file system,in an SQLite database,or in any other manner that makes sense. The content provider extends the ContentProvider base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls. However,applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead. A ContentResolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involved.

provider管理的数据不只是在SQLite里面的,文件系统里面的也。应用要使用数据,要用ContentResolver object ,进程间的,也用它,比如访问其他应用的数据。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读