Search code examples
androidkotlindelegateskotlin-delegatemvrx

Android studio is not able to resolve import


I am trying to work on a sample project to learn MvRx. However, seems something is wrong. Android Studio is not able to find and import activityViewModel automatically.

1) I tried to import it manually by writing its package name but it is still gray.

2) From Gradle tab, I selected my root project and clicked on Refresh Gradle Project in order to refresh all dependencies. It did not help, too.

What is the problem?

enter image description here


Solution

  • Your feature code must be in a Fragment (that extends BaseMvRxFragment), not in an Activity.