title: ViewModel not Working?
body: <p>I am following exactly the same as mentioned in the official documentation. </p>
  
  <pre><code>public class MyViewModel extends ViewModel {
      private MutableLiveData&lt;List&lt;User&gt;&gt; users;
      public LiveData&lt;List&lt;User&gt;&gt; getUsers() {
          if (users == null) {
              users = new MutableLiveData&lt;List&lt;Users&gt;&gt;();
              loadUsers(); //the method is working fine
          }
          return users;
      }
  }
  </code></pre>
  
  <p>And then in activity </p>
  
  <pre><code>public class MyActivity extends AppCompatActivity {
      public void onCreate(Bundle savedInstanceState) {
          // Create a ViewModel the first time the system calls an activity's onCreate() method.
          // Re-created activities receive the same MyViewModel instance created by the first activity.
  
          MyViewModel model = ViewModelProviders.of(this).get(MyViewModel.class);
          model.getUsers().observe(this, users -&gt; {
              // update UI
          });
      }
  }
  </code></pre>
  
  <p>My load users method is working fine. But IDE is giving an error that lambda expressions are not supported. I also updated the JDK but still it is not working. </p>