Presentation is loading. Please wait.

Presentation is loading. Please wait.

Adding Functionality to the App Tip Calculator App Activity and the Activity Lifecycle onCreate is called by the system when an Activity.

Similar presentations


Presentation on theme: "Adding Functionality to the App Tip Calculator App Activity and the Activity Lifecycle onCreate is called by the system when an Activity."— Presentation transcript:

1

2

3

4

5

6

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

9

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.

14

15

16

17

18

19


Download ppt "Adding Functionality to the App Tip Calculator App Activity and the Activity Lifecycle onCreate is called by the system when an Activity."

Similar presentations


Ads by Google