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;
protected OsmandApplication getMyApplication() {
if (isAdded()) {
return (OsmandApplication) getActivity().getApplication();
}
return null;
return (OsmandApplication) getActivity().getApplication();
}
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
protected void onDestroy() {
super.onDestroy();