Defining application activities

To sum up, we will have three activities:

  • Landing activity (MainActivty.kt)
  • Add/Edit note screen
  • Add/Edit TODO screen

It's common practice in Android development to create an activity that will be a parent class to all other activities because, like this, we will reduce code base and share it at the same time with multiple activites. In most cases, Android developers call it BaseActivity. We will define our version of BaseActivity. Create a new class called BaseActivity; the BaseActivity.kt file is created. Make sure the newly created class is located under the Activity package of your project.

The BaseActivity class must extend the FragmentActivity class of Android SDK. We will extend FragmentActivity because ...

Get Mastering Android Development with Kotlin 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.