File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
app/src/main/java/com/example/android/devbyteviewer/ui Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -44,12 +44,12 @@ class DevByteFragment : Fragment() {
4444
4545 /* *
4646 * One way to delay creation of the viewModel until an appropriate lifecycle method is to use
47- * lazy. This requires that viewModel not be referenced before onActivityCreated , which we
47+ * lazy. This requires that viewModel not be referenced before onViewCreated() , which we
4848 * do in this Fragment.
4949 */
5050 private val viewModel: DevByteViewModel by lazy {
5151 val activity = requireNotNull(this .activity) {
52- " You can only access the viewModel after onActivityCreated ()"
52+ " You can only access the viewModel after onViewCreated ()"
5353 }
5454 // The ViewModelProviders (plural) is deprecated.
5555 // ViewModelProviders.of(this, DevByteViewModel.Factory(activity.application)).get(DevByteViewModel::class.java)
You can’t perform that action at this time.
0 commit comments