1

How should I handle globally no internet exception, so what I want to archive is to display a snackbar every time there is a call. I archived that on each call:

@Override
    public void onFailure(@NonNull Call<UserProfileResponse> call, @NonNull Throwable t) {
           Snackbar.make(findViewById(android.R.id.content),"Message",Snackbar.LENGTH_LONG).show();

    }

I read about adding an Interceptor on OkHttp client, but there I can't get the view for the SnackBar.

TOvidiu
  • 1,036
  • 11
  • 15
  • have a look at this answer https://stackoverflow.com/questions/25678216/android-internet-connectivity-change-listener – Harkal Jul 08 '18 at 20:26

0 Answers0