A simple Android app that demonstrates the Activity lifecycle using two Activities and logging the different lifecycle events.
Activity is one of four main components of Android OS. An activity can be simply defined as a screen that user interact with. Every activity has a lifespan that includes methods like
- onCreate()
- onStart()
- onResume()
- onPause()
- onStop()
- onDestroy()
This repository is an example implementation of these activity life cyvcle methods.
Further information : https://developer.android.com/guide/components/activities/activity-lifecycle
- Two Activities (MainActivity and MainActivity2)
- Demonstrates the lifecycle events of an Activity
- Navigation between the two Activities using buttons
- Clone the repository to your local machine:
git clone https://github.com/your_username/activity_lifecycle_demo.git
-
Open the project in Android Studio and build it.
-
Run the app on an emulator or a physical device.
The app displays two Activities. By pressing the buttons, you can navigate between the Activities and observe the Activity lifecycle events in the logcat.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.