From 1dfe5f623cce8fcfd445b0e0c496dd0bc2e59cd2 Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Mon, 3 May 2021 17:18:41 +0900 Subject: [PATCH] Use Toast instead of SnackBar. Probable workaround for austinhuang0131/barinsta#1027 --- .../webservices/interceptors/IgErrorsInterceptor.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/webservices/interceptors/IgErrorsInterceptor.java b/app/src/main/java/awais/instagrabber/webservices/interceptors/IgErrorsInterceptor.java index 99659b46..cd5068fb 100644 --- a/app/src/main/java/awais/instagrabber/webservices/interceptors/IgErrorsInterceptor.java +++ b/app/src/main/java/awais/instagrabber/webservices/interceptors/IgErrorsInterceptor.java @@ -1,14 +1,12 @@ package awais.instagrabber.webservices.interceptors; import android.util.Log; -import android.view.View; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.StringRes; import androidx.fragment.app.FragmentManager; -import com.google.android.material.snackbar.Snackbar; - import org.json.JSONObject; import java.io.IOException; @@ -105,9 +103,9 @@ public class IgErrorsInterceptor implements Interceptor { private void showSnackbar(final String message) { final MainActivity mainActivity = MainActivity.getInstance(); if (mainActivity == null) return; - final View view = mainActivity.getRootView(); - if (view == null) return; - Snackbar.make(view, message, Snackbar.LENGTH_LONG).show(); + // final View view = mainActivity.getRootView(); + // if (view == null) return; + Toast.makeText(mainActivity.getApplicationContext(), message, Toast.LENGTH_LONG).show(); } @NonNull