From e6aa38a89d01e6cc33b53b644e6b7c6411e11366 Mon Sep 17 00:00:00 2001 From: Denis Date: Fri, 19 Dec 2014 14:20:24 +0200 Subject: [PATCH 1/2] possible fix for NPE in manage maps --- OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index 63508a91ea..ffc0507eb2 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -478,6 +478,9 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { + if (this.isDetached()) { + return; + } //fixes issue when local files not shown after switching tabs if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0){ for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()){ From f7f5436a8b8f662f494abe951c664479c87f33e9 Mon Sep 17 00:00:00 2001 From: Denis Date: Fri, 19 Dec 2014 14:46:39 +0200 Subject: [PATCH 2/2] Changed code to find exact problem of manage map crashes --- .../src/net/osmand/plus/download/LocalIndexesFragment.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index ffc0507eb2..408ed86218 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -478,11 +478,9 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - if (this.isDetached()) { - return; - } //fixes issue when local files not shown after switching tabs - if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0){ + if (listAdapter.getGroupCount() == 0 && + getDownloadActivity().getLocalIndexInfos().size() > 0){ for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()){ listAdapter.addLocalIndexInfo(info); }