SHARE
TWEET

Untitled

a guest Mar 24th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MainViewModel viewModel = ViewModelProviders.of(this).get(MainViewModel.class);
  2. viewModel.makeQuery().observe(this, new androidx.lifecycle.Observer<ResponseBody>() {
  3.     @Override
  4.     public void onChanged(ResponseBody responseBody) {
  5.         Log.d(TAG, "onChanged: this is a live data response!");
  6.         try {
  7.             Log.d(TAG, "onChanged: " + responseBody.string());
  8.         } catch (IOException e) {
  9.             e.printStackTrace();
  10.         }
  11.     }
  12. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top