From 238b886ea6a1573da9aa34c13d7885dd3ebe4ec1 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 5 Jan 2015 13:08:04 +0200 Subject: [PATCH] Fixed bug with MapFragment sets image in wrong thread. --- .../net/osmand/plus/dashboard/DashMapFragment.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashMapFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashMapFragment.java index a7a5b8b8f5..b4527e4c28 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashMapFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashMapFragment.java @@ -78,10 +78,16 @@ public class DashMapFragment extends DashBaseFragment implements IMapDownloaderC if (view == null) { return; } - Bitmap image = getMyApplication().getResourceManager().getRenderer().getBitmap(); - ImageView map = (ImageView) view.findViewById(R.id.map_image); + final Bitmap image = getMyApplication().getResourceManager().getRenderer().getBitmap(); + final ImageView map = (ImageView) view.findViewById(R.id.map_image); if (image != null) { - map.setImageBitmap(image); + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + map.setImageBitmap(image); + } + }); + } }