zoukankan      html  css  js  c++  java
  • Intent七大属性之总结


    参考《疯狂android讲义》第5章


    1、Intent 用于封装程序的”调用意图“,不管想启动一个Acitivity、Service还是BroadcastReceiver,Android均使用统一的Intent对象来封装这种”启动意图“。很明显使用Intent提供了一致的编程模型。


    2、Intent还有一个好处,如果应用程序只是想启动具有某种特征的组件,并不想和某个具体的组件耦合,则可以通过在intent-filter中配置相应的属性进行处理,与stucts2中的MVC框架思路类似。


    3、Intent对象大致包括7大属性:ComponentName  Action  Category  Data  Type  Extra  Flag。


    4、7大属性中,前面5个均用于指定本intent用于启动哪个组件,ComponentName直接指定组件的名称,后4个指定类型,只要符合此类型条件的组件均可响应此Intnet。前者称为显式Intnet,后者称为隐式intent。前者一般用于启动自身程序的其它组件,后者一用于启动其它程序的组件(包括系统组件)。

    • Explicit intents designate the target component by its name (the component name field, mentioned earlier, has a value set). Since component names would generally not be known to developers of other applications, explicit intents are typically used for application-internal messages — such as an activity startinga subordinate service or launching a sister activity.
    • Implicit intents do not name a target (the field for the component name is blank). Implicit intents are often used to activate componentsin other applications.



    说见Intent七大属性之一~~~七

  • 相关阅读:
    [转载]ASP.NET中IsPostBack详解
    [转载]论asp.net out、ref、return
    用CSS让字体在一行内显示不换行
    改变时间格式的方法
    JS方法的使用
    [转载] iframe嵌入网页的用法
    iphone6 inline-flex兼容问题
    ActionResult的其它返回值
    为什么java中只允许继承一个类?
    关于asp.net MVC3 ----@Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction
  • 原文地址:https://www.cnblogs.com/jediael/p/4304176.html
Copyright © 2011-2022 走看看