android_intent

Intent 的几大属性

  • ComponentName (组件名称)
  • Action

字符串类型

1
intent.setAction("com.example.lwj.activitytest");

  • Category
    分类 进一步筛选要选择的内容 一般放在标签中 常用的有:
    LAUNCHER 、DEFAULT、 HOME

  • Extra 附加信息(键值对)

传值
putExtra()

1
2
3
4
5
if (getIntent() != null){
Intent intent = getIntent();
String info = intent.getStringExtra("info");
}
  • Data