42.1 Removing the Redundant Code
Before implementing data binding within the ViewModelDemo app, the power of data binding will be demonstrated by deleting all of the code within the project that will no longer be needed by the end of this chapter.
Launch Android Studio, open the ViewModelDemo project, edit the MainFragment.kt file and modify the code as follows:
package com.ebookfrenzy.viewmodeldemo.ui.main
import androidx.lifecycle.ViewModelProviders
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.ebookfrenzy.viewmodeldemo.R
import androidx.lifecycle.Observer
import kotlinx.android.synthetic.main.main_fragment.*
class MainFragment : Fragment() {
.
.
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated...