美文网首页
安卓Intent

安卓Intent

作者: watayouxiang | 来源:发表于2017-05-13 22:04 被阅读13次

Intent可以传递哪些类型数据

  • java基本数据类型:整型,浮点,字符,布尔
  • String
  • 实现了Serializable和Parcelable接口的对象

Serializable 和Parcelable 的区别

Parcelable:将对象数据存在内存,效率高,安卓API

Serializable:将对象数据存在磁盘上,效率低,java API

请描述一下Intent 和IntentFilter

Intent包含消息以及消息的目的地,相当一份邮件

IntentFilter相当于邮件分拣系统,通过三个参数进行分拣

  • Action: 动作

      <intent-filter >
      <action android:name="android.intent.action.MAIN" />
      <action android:name="cn.itheima.action" />
      ……
      </intent-filter>
    
      //---------------------------
    
      Intent intent =new Intent();
      intent.setAction("cn.itheima.action");
    
  • Data:数据uri

      <data 
          android:mimeType="mimeType" 
          android:scheme="scheme"
          android:host="host" 
          android:port="port" 
          android:path="path" />
    
  • Category: 附加信息

    • <intent-filter >节点中可以为组件定义一个Category 类别列表,当Intent 中包含这个列表的所有项目时
      Category 类别匹配才会成功。

相关文章

  • 安卓intent

    Intent list1 = new Intent(MainActivity.this,你要跳转的activity...

  • 安卓Intent

    Intent可以传递哪些类型数据 java基本数据类型:整型,浮点,字符,布尔 String 实现了Seriali...

  • Android Intent 和 启动模式

    Intent 中文翻译可以是 意图,即想要做什么,其在Android中的功能和字面意思差不多。 安卓 Intent...

  • 安卓中的intent

    intent分为显式intent和隐式intent 创建显式intent时需要指明被启动的类的定义,明确说明了要启...

  • 安卓活动跳转intent

    在开发android的应用中,有时候需要限制横竖屏切换。只需要在AndroidManifest.xml文件中加入a...

  • Intent数据传输:超简洁

    用Intent传输数据是安卓常用技术之一,通常的方法是声名一堆键名(key_name),把数据存储到Intent中...

  • 安卓初级学习项目demo

    目标:学习安卓初级应用内容:1,使用四大组件Intent、Activity、Broadcast、Services2...

  • 363,intent和onNewIntent

    以下通过Kotlin来写,就当顺手学Kotlin了。 安卓通过intent来启动activity,例如: Seco...

  • Android分享操作

    现在用的比较多的都是三方的分享,其实安卓自带的就有简单的分享。 在构建Intent时,可以指定这个Intent需要...

  • 安卓实现IPC(二)—— Intent

    上一篇文章(安卓实现IPC(一)—— IPC概论)提到了安卓实现IPC的四种方式,第一种就是使用Intent来实现...

网友评论

      本文标题:安卓Intent

      本文链接:https://www.haomeiwen.com/subject/qyrfxxtx.html