Intent七在属性之一:ComponentName
注:在《瘋狂android講義》中,此屬性稱為Component,官方文檔中稱為ComponentName。
1、The name of the component that should handle the intent. This field is a ComponentName object — a combination of the fully qualified class name of the target component (for example "com.example.project.app.FreneticActivity") and the package name set in the manifest file of the application where the component resides (for example, "com.example.project"). The package part of the component name and the package name set in the manifest do not necessarily have to match.
The component name is optional. If it is set, the Intent object is delivered to an instance of the designated class. If it is not set, Android uses other information in the Intent object to locate a suitable target — see Intent Resolution, later in this document.
The component name is set by setComponent(), setClass(), or setClassName() and read by getComponent().
2、ComponentName用于顯式指定Intent所對應的組件。
總結
以上是生活随笔為你收集整理的Intent七在属性之一:ComponentName的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Intent七大属性之总结
- 下一篇: Github android客户端源代码