Download presentation
Presentation is loading. Please wait.
Published byΔανάη Αγγελοπούλου Modified over 6 years ago
7
Adding Functionality to the App
8
Tip Calculator App Activity and the Activity Lifecycle
onCreate is called by the system when an Activity is starting and its GUI is about to be displayed so that the user can interact with the Activity. OnSaveInstanceState is called by the system when the configuration of the device changes during the app’s execution
10
Overriding Method OnCreate of Class Activity
11
Overriding Method OnCreate of Class Activity
When the system calls onCreate, it passes a Bundle to parameter savedInstanceState. this state information is saved by the Activity’s onSaveInstanceState Method. Generated class R that contains nested static classes representing each type of resource in your project’s res folder. You can find R class in your project’s gen folder, which contains generated source-code files.
12
Some of the nested classes in class R include
13
inflating the GUI setContentView receives the constant R.layout.main to indicate which XML file represents the activity’s GUI. the constant represents the main.xml file. Method setContentView uses this constant to load the corresponding XML and converted into the app’s GUI.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.