mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar
This commit is contained in:
parent
5fdb6fc77a
commit
314ebd8919
1 changed files with 8 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import android.view.Display;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import timber.log.Timber;
|
||||||
|
|
||||||
public class ViewUtil {
|
public class ViewUtil {
|
||||||
|
|
||||||
|
|
@ -25,7 +26,13 @@ public class ViewUtil {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecutorUtils.uiExecutor().execute(() -> Snackbar.make(view, messageResourceId, Snackbar.LENGTH_SHORT).show());
|
ExecutorUtils.uiExecutor().execute(() -> {
|
||||||
|
try {
|
||||||
|
Snackbar.make(view, messageResourceId, Snackbar.LENGTH_SHORT).show();
|
||||||
|
}catch (IllegalStateException e){
|
||||||
|
Timber.e(e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showLongToast(Context context, String text) {
|
public static void showLongToast(Context context, String text) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue