diff --git a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java index 300d60e521..ad1e1fac35 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MainMenuActivity.java @@ -138,7 +138,7 @@ public class MainMenuActivity extends BaseDownloadActivity implements OsmAndLoca @Override public void onScrollChanged() { int scrollY = mainScroll.getScrollY(); - if (previousScroll == scrollY){ + if (previousScroll == scrollY || mainScroll.getChildAt(0) == null){ return; } diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java index 0bf757ac74..30b5a35146 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashDownloadMapsFragment.java @@ -84,6 +84,9 @@ public class DashDownloadMapsFragment extends DashBaseFragment { } protected void updateCount(String s) { + if (DashDownloadMapsFragment.this.isDetached()){ + return; + } File ms = getMyApplication().getAppPath(s); if (ms.exists()) { File[] lf = ms.listFiles(); @@ -101,6 +104,9 @@ public class DashDownloadMapsFragment extends DashBaseFragment { @Override protected void onPostExecute(Void result) { super.onPostExecute(result); + if (DashDownloadMapsFragment.this.isDetached()){ + return; + } if(countMaps > 0) { long mb = 1 << 20; long gb = 1 << 30;