Fix crash with OSM Live update

This commit is contained in:
Alexander Sytnyk 2017-07-10 15:26:11 +03:00
parent 7ea02dcdae
commit b6f6680557
2 changed files with 7 additions and 4 deletions

View file

@ -18,10 +18,7 @@ public class BaseOsmAndFragment extends Fragment {
private IconsCache iconsCache; private IconsCache iconsCache;
protected OsmandApplication getMyApplication() { protected OsmandApplication getMyApplication() {
if (isAdded()) { return (OsmandApplication) getActivity().getApplication();
return (OsmandApplication) getActivity().getApplication();
}
return null;
} }
protected OsmandActionBarActivity getMyActivity() { protected OsmandActionBarActivity getMyActivity() {

View file

@ -79,6 +79,12 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa
} }
} }
@Override
protected void onPause() {
super.onPause();
getMyApplication().getDownloadThread().resetUiActivity(this);
}
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();