File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
app/src/main/java/com/example/android/devbyteviewer/ui Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ import androidx.annotation.LayoutRes
2727import androidx.databinding.DataBindingUtil
2828import androidx.fragment.app.Fragment
2929import androidx.lifecycle.Observer
30- import androidx.lifecycle.ViewModelProviders
30+ // import androidx.lifecycle.ViewModelProviders
31+ import androidx.lifecycle.ViewModelProvider
3132import androidx.recyclerview.widget.LinearLayoutManager
3233import androidx.recyclerview.widget.RecyclerView
3334import com.example.android.devbyteviewer.R
@@ -50,8 +51,10 @@ class DevByteFragment : Fragment() {
5051 val activity = requireNotNull(this .activity) {
5152 " You can only access the viewModel after onActivityCreated()"
5253 }
53- ViewModelProviders .of(this , DevByteViewModel .Factory (activity.application))
54- .get(DevByteViewModel ::class .java)
54+ // The ViewModelProviders (plural) is deprecated.
55+ // ViewModelProviders.of(this, DevByteViewModel.Factory(activity.application)).get(DevByteViewModel::class.java)
56+ ViewModelProvider (this , DevByteViewModel .Factory (activity.application)).get(DevByteViewModel ::class .java)
57+
5558 }
5659
5760 /* *
You can’t perform that action at this time.
0 commit comments