Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MainViewModel viewModel = ViewModelProviders.of(this).get(MainViewModel.class);
- viewModel.makeQuery().observe(this, new androidx.lifecycle.Observer<ResponseBody>() {
- @Override
- public void onChanged(ResponseBody responseBody) {
- Log.d(TAG, "onChanged: this is a live data response!");
- try {
- Log.d(TAG, "onChanged: " + responseBody.string());
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement