diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashBaseFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashBaseFragment.java index f6411de761..9a4fe6a4b2 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashBaseFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashBaseFragment.java @@ -9,6 +9,9 @@ import net.osmand.plus.OsmandApplication; public class DashBaseFragment extends SherlockFragment { public OsmandApplication getMyApplication(){ + if (getActivity() == null){ + return null; + } return (OsmandApplication) getActivity().getApplication(); } diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java index a34bce2a2e..0f67c08a45 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java @@ -84,7 +84,8 @@ public class DashDownloadMapsFragment extends DashBaseFragment { } protected void updateCount(String s) { - if (!DashDownloadMapsFragment.this.isAdded()){ + if (!DashDownloadMapsFragment.this.isAdded() || + getMyApplication() == null){ return; } File ms = getMyApplication().getAppPath(s); @@ -104,7 +105,8 @@ public class DashDownloadMapsFragment extends DashBaseFragment { @Override protected void onPostExecute(Void result) { super.onPostExecute(result); - if (!DashDownloadMapsFragment.this.isAdded()){ + if (!DashDownloadMapsFragment.this.isAdded() + || getMyApplication() == null){ return; } if(countMaps > 0) { 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); + } + }); + } } diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java index 660bad87d2..ca82f99671 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashUpdatesFragment.java @@ -143,9 +143,10 @@ public class DashUpdatesFragment extends DashBaseFragment { //needed when rotation is performed and progress can be null if (!updateOnlyProgress) { getProgressIfPossible(basicProgressAsyncTask.getDescription()); - if (currentProgress == null) { - return; - } + } + + if (currentProgress == null) { + return; } if (updateOnlyProgress) { diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index 107e5d1ea5..86ebacc93d 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -841,6 +841,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { } } listAdapter.notifyDataSetChanged(); + expandAllGroups(); } public void cancelFilter(){ diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java index a54a64b868..0d4cd6f654 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java @@ -333,7 +333,7 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer @Override public void registerOptionsMenuItems(final MapActivity mapActivity, ContextMenuAdapter helper) { - helper.item(R.string.osmo_groups).icons(R.drawable.ic_action_eye_dark, R.drawable.ic_action_eye_light).position(6) + helper.item(R.string.osmo_groups).icons(R.drawable.ic_osmo_dark, R.drawable.ic_osmo_light).position(6) .listen(new OnContextMenuClick() { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) {