From b2ae67ba39cf72f538affed9e2ccfbb0dcfc9be3 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 27 Nov 2020 13:00:06 +0200 Subject: [PATCH] show error bug fix --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 0e62a6e48f..199d0c930c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -14,6 +14,8 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.net.Uri; import android.os.AsyncTask; +import android.os.Handler; +import android.os.Looper; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextUtils; @@ -487,10 +489,10 @@ public class MenuBuilder { } private void showToastMessage(final String str) { - app.runInUIThread(new Runnable() { + new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { - Toast.makeText(view.getContext(), str, Toast.LENGTH_LONG).show(); + Toast.makeText(mapActivity.getBaseContext(), str, Toast.LENGTH_LONG).show(); } }); }