使用隐式Intent时,需要使用到意图过滤器Intent-filter。Intent-filter含有三个属性:action,category,data。通过这三个属性的组合,可以启动想要启动的activity,service或者broadcast receiver,同时过滤掉那些没有意义的组件。

action,一个Intent-filter最少含有一个action元素,没有action的intent,无法启动

<action android:name="android.intent.action.xxx" />

category,一个Intent-filter必须含有categoty的默认值<category android:name="android.intent.category.DEFAULT"/>

data,

相关文章:

  • 2021-10-27
  • 2022-02-02
  • 2022-01-06
  • 2021-12-05
  • 2022-12-23
  • 2021-06-07
  • 2021-11-10
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案