Methods in the Activity class

  • OnCreate(): When a user clicks on the app icon to start the application, this method is called. This method is used to perform some initial setup that might be required for the activity, for example, creating views, initializing variables, and much more:

Let's have a look at our application code where we used the OnCreate() method to do some initialization and setup:

The things we are doing in our OnCreate() method are:

    • Setting up a layout for the view
    • Initializing variables to get references to TextInput ...

Get Mobile DevOps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.