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;
}
public boolean isActivityStopped() {
return stopped;
}
private void restartApp() {
AlertDialog.Builder bld = new AlertDialog.Builder(this);
bld.setMessage(R.string.storage_permission_restart_is_required);

View file

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