Added toast about empty file name
This commit is contained in:
parent
a314f06e87
commit
d40f095ae7
1 changed files with 5 additions and 0 deletions
|
@ -36,6 +36,7 @@ import net.osmand.plus.myplaces.AvailableGPXFragment;
|
|||
import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.plus.widgets.OsmandTextFieldBoxes;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -171,6 +172,10 @@ public class OnSaveCurrentTrackFragment extends BottomSheetDialogFragment {
|
|||
if (savedGpxName.equalsIgnoreCase(newGpxName)) {
|
||||
return savedFile;
|
||||
}
|
||||
if (Algorithms.isEmpty(newGpxName)) {
|
||||
Toast.makeText(app, R.string.empty_filename, Toast.LENGTH_LONG).show();
|
||||
return null;
|
||||
}
|
||||
return LocalIndexesFragment.renameGpxFile(app, savedFile, newGpxName + ".gpx", null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue