From 706a5b2197afe90e3bd4a79e72114cb3a9238f19 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 14 Jul 2014 19:56:03 +0200 Subject: [PATCH] Fix crash --- .../plus/osmedit/OpenstreetmapRemoteUtil.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index 6314510e36..d1bfabf1d5 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -359,12 +359,15 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { return null; } - } catch (IOException e) { + } catch (Exception e) { log.error("Loading node failed " + nodeId, e); //$NON-NLS-1$ - AccessibleToast.makeText(ctx, ctx.getResources().getString(R.string.error_io_error), Toast.LENGTH_LONG).show(); - } catch (SAXException e) { - log.error("Loading node failed " + nodeId, e); //$NON-NLS-1$ - AccessibleToast.makeText(ctx, ctx.getResources().getString(R.string.error_io_error), Toast.LENGTH_LONG).show(); + ctx.runInUIThread(new Runnable() { + + @Override + public void run() { + AccessibleToast.makeText(ctx, ctx.getResources().getString(R.string.error_io_error), Toast.LENGTH_LONG).show(); + } + }); } return null; }