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() {
44
44
45
45
/* *
46
46
* 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
48
48
* do in this Fragment.
49
49
*/
50
50
private val viewModel: DevByteViewModel by lazy {
51
51
val activity = requireNotNull(this .activity) {
52
- " You can only access the viewModel after onActivityCreated ()"
52
+ " You can only access the viewModel after onViewCreated ()"
53
53
}
54
54
// The ViewModelProviders (plural) is deprecated.
55
55
// ViewModelProviders.of(this, DevByteViewModel.Factory(activity.application)).get(DevByteViewModel::class.java)
You can’t perform that action at this time.
0 commit comments