diff --git a/app/src/main/java/net/osmtracker/gpx/ExportToTempFileTask.java b/app/src/main/java/net/osmtracker/gpx/ExportToTempFileTask.java index 8c1a3d30..03871a0b 100644 --- a/app/src/main/java/net/osmtracker/gpx/ExportToTempFileTask.java +++ b/app/src/main/java/net/osmtracker/gpx/ExportToTempFileTask.java @@ -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; @@ -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); }