This commit is contained in:
Victor Shcherb 2018-04-15 16:50:04 +02:00
parent 1c6f0b371d
commit 810658a364
3 changed files with 6 additions and 5 deletions

View file

@ -1212,7 +1212,7 @@ public class GPXUtilities {
fout.getParentFile().mkdirs(); fout.getParentFile().mkdirs();
output = new OutputStreamWriter(new FileOutputStream(fout), "UTF-8"); //$NON-NLS-1$ output = new OutputStreamWriter(new FileOutputStream(fout), "UTF-8"); //$NON-NLS-1$
String msg = writeGpx(output, file, ctx); String msg = writeGpx(output, file, ctx);
if(file.path == null) { if(Algorithms.isEmpty(file.path)) {
file.path = fout.getAbsolutePath(); file.path = fout.getAbsolutePath();
} }
return msg; return msg;

View file

@ -72,11 +72,13 @@ public class TrackActivity extends TabActivity {
finish(); finish();
return; return;
} }
file = null;
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
if (intent.hasExtra(TRACK_FILE_NAME)) { if (intent.hasExtra(TRACK_FILE_NAME)) {
file = new File(intent.getStringExtra(TRACK_FILE_NAME)); file = new File(intent.getStringExtra(TRACK_FILE_NAME));
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
if(file != null) {
String fn = file.getName().replace(".gpx", "").replace("/", " ").replace("_", " "); String fn = file.getName().replace(".gpx", "").replace("/", " ").replace("_", " ");
actionBar.setTitle(fn); actionBar.setTitle(fn);
} else { } else {

View file

@ -239,7 +239,6 @@ public class WikivoyageLocalDataHelper {
conn.execSQL(BOOKMARKS_TABLE_CREATE); conn.execSQL(BOOKMARKS_TABLE_CREATE);
} }
@SuppressWarnings("unused")
private void onUpgrade(SQLiteConnection conn, int oldVersion, int newVersion) { private void onUpgrade(SQLiteConnection conn, int oldVersion, int newVersion) {
if (oldVersion < 2) { if (oldVersion < 2) {
conn.execSQL(BOOKMARKS_TABLE_CREATE); conn.execSQL(BOOKMARKS_TABLE_CREATE);