Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  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. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement