From b6f668055720d0a16ded5af7e716b6f9feae29ea Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 10 Jul 2017 15:26:11 +0300 Subject: [PATCH] Fix crash with OSM Live update --- OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java | 5 +---- OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java b/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java index 11d1451f17..dfb2aab34f 100644 --- a/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/BaseOsmAndFragment.java @@ -18,10 +18,7 @@ public class BaseOsmAndFragment extends Fragment { private IconsCache iconsCache; protected OsmandApplication getMyApplication() { - if (isAdded()) { - return (OsmandApplication) getActivity().getApplication(); - } - return null; + return (OsmandApplication) getActivity().getApplication(); } protected OsmandActionBarActivity getMyActivity() { diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java b/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java index d3915d43a6..7acf7f6cd9 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/OsmLiveActivity.java @@ -79,6 +79,12 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa } } + @Override + protected void onPause() { + super.onPause(); + getMyApplication().getDownloadThread().resetUiActivity(this); + } + @Override protected void onDestroy() { super.onDestroy();