From ba1b578f5cd33deb5382a0125ed3801d3664a42c Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 11 Dec 2017 12:19:13 +0200 Subject: [PATCH] Finish action mode in onPause() --- .../net/osmand/plus/activities/FavoritesTreeFragment.java | 8 ++++++++ OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java | 8 ++++++++ .../net/osmand/plus/myplaces/AvailableGPXFragment.java | 3 +++ OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java | 8 ++++++++ 4 files changed, 27 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index bf00d38ae4..93f0275ae2 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -209,6 +209,14 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment { initListExpandedState(); } + @Override + public void onPause() { + super.onPause(); + if (actionMode != null) { + actionMode.finish(); + } + } + private int getSelectedFavoritesCount() { int count = 0; for (Set set : favoritesSelected.values()) { diff --git a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java index 12e5c7defb..987a5b9943 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/NotesFragment.java @@ -136,6 +136,14 @@ public class NotesFragment extends OsmAndListFragment { listView.setAdapter(listAdapter); } + @Override + public void onPause() { + super.onPause(); + if (actionMode != null) { + actionMode.finish(); + } + } + @Override public ArrayAdapter getAdapter() { return listAdapter; diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 2e2179accc..dd72e26959 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -207,6 +207,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { asyncProcessor.cancel(false); asyncProcessor = null; } + if (actionMode != null) { + actionMode.finish(); + } } public void updateCurrentTrack() { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java index 9a20d11c25..71e66f48da 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsFragment.java @@ -332,6 +332,14 @@ public class OsmEditsFragment extends OsmAndListFragment implements SendPoiDialo fetchData(); } + @Override + public void onPause() { + super.onPause(); + if (actionMode != null) { + actionMode.finish(); + } + } + private void fetchData() { boolean portrait = AndroidUiHelper.isOrientationPortrait(getActivity()); osmEdits = new ArrayList<>();