pr cleanup

This commit is contained in:
madwasp79 2019-07-09 12:32:24 +03:00
parent a351668860
commit ab96fe684e
2 changed files with 7 additions and 10 deletions

View file

@ -1032,10 +1032,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return mIsDestroyed; return mIsDestroyed;
} }
public boolean isActivityStopped() {
return stopped;
}
private void restartApp() { private void restartApp() {
AlertDialog.Builder bld = new AlertDialog.Builder(this); AlertDialog.Builder bld = new AlertDialog.Builder(this);
bld.setMessage(R.string.storage_permission_restart_is_required); bld.setMessage(R.string.storage_permission_restart_is_required);

View file

@ -372,13 +372,14 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
isSaving = false; isSaving = false;
app.getNotificationHelper().refreshNotifications(); app.getNotificationHelper().refreshNotifications();
updateControl(); updateControl();
if (weakReferenceToActivity != null && weakReferenceToActivity.get() instanceof MapActivity if (weakReferenceToActivity != null) {
&& !((MapActivity) weakReferenceToActivity.get()).isActivityStopped() final Activity a = weakReferenceToActivity.get();
&& !((MapActivity) weakReferenceToActivity.get()).isActivityDestroyed() if (a instanceof MapActivity && !a.isFinishing() && !Algorithms.isEmpty(result.getFilenames())) {
&& !Algorithms.isEmpty(result.getFilenames())) { OnSaveCurrentTrackFragment.showInstance(((MapActivity) a)
OnSaveCurrentTrackFragment.showInstance(((MapActivity) weakReferenceToActivity.get())
.getSupportFragmentManager(), result.getFilenames().get(0)); .getSupportFragmentManager(), result.getFilenames().get(0));
} }
}
if (onComplete != null) { if (onComplete != null) {
onComplete.run(); onComplete.run();
} }