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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.