Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #333: Change exported GPX filenames to 'YYYY-MM-DD_hh-mm-ss_OSMTracker.gpx' #482

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.database.Cursor;
import android.util.Log;

import net.osmtracker.db.DataHelper;
import net.osmtracker.exception.ExportTrackException;

import java.io.File;
Expand All @@ -25,9 +26,10 @@ public abstract class ExportToTempFileTask extends ExportTrackTask {
public ExportToTempFileTask(Context context, long trackId) {
super(context, trackId);
try {
tmpFile = File.createTempFile("osm-upload", ".gpx", context.getCacheDir());
tmpFile = new File(context.getCacheDir(), new DataHelper(context).getTrackById(trackId).getName()+"_OSMTracker.gpx");
Log.d(TAG, "Temporary file: " + tmpFile.getAbsolutePath());
} catch (IOException ioe) {

} catch (Exception ioe) {
Log.e(TAG, "Could not create temporary file", ioe);
throw new IllegalStateException("Could not create temporary file", ioe);
}
Expand Down
Loading