Activity Class, Intent Class, Fragment Class.
时间: 2024-01-11 11:02:08 浏览: 70
Fragment 和 Activiyt的交互
Activity Class:
The Activity class is a fundamental component of the Android application framework. It represents a single screen with a user interface, and it is responsible for managing the lifecycle of the screen. An activity is typically implemented as a subclass of the Activity class, and it can interact with other activities and the overall application framework.
Intent Class:
The Intent class is used to describe an action to be performed, such as opening a new activity, sending a broadcast message, or starting a service. Intents are used to communicate between different components of an Android application, or between different applications. An intent can contain data, such as a URI or an extra value, which is used to provide additional information to the target component.
Fragment Class:
The Fragment class is used to represent a reusable portion of the user interface in an activity. Fragments can be combined to create a rich and flexible user interface, and they can be reused across different activities. Fragments have their own lifecycle, which is managed by the hosting activity. They can be added, removed, or replaced at runtime, and they can be used to create dynamic and adaptable user interfaces.
阅读全文