From 6c2f536d633f1cc2d74f248c4016021fba176d90 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 14 Jun 2015 20:51:55 +0200 Subject: [PATCH 1/2] Fix downnload activity archive --- OsmAnd/src/net/osmand/plus/download/DownloadActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 824237f0fd..2cecfb77fa 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -31,6 +31,7 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.ListFragment; import android.support.v4.view.ViewPager; +import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; @@ -379,8 +380,11 @@ public class DownloadActivity extends BaseDownloadActivity { public void onClick(DialogInterface dialog, int which) { for(String w : wiki) { File fl = new File(w); - File nf = new File(fl.getParentFile() +"/" + IndexConstants.BACKUP_INDEX_DIR, fl.getName()); - fl.renameTo(nf); + File nf = new File(fl.getParentFile(), IndexConstants.BACKUP_INDEX_DIR + "/"+fl.getName()); + boolean res = fl.renameTo(nf); + if(!res) { + System.err.println("Renaming from " + fl.getAbsolutePath() + " to " + nf.getAbsolutePath() + " failed"); + } } } }); From fafe44d97f4c21bfab58de5acf3e4f1448df99c5 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 14 Jun 2015 20:57:04 +0200 Subject: [PATCH 2/2] Fix archive wiki --- OsmAnd/src/net/osmand/plus/download/DownloadActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 2cecfb77fa..64b2f53455 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -379,7 +379,7 @@ public class DownloadActivity extends BaseDownloadActivity { @Override public void onClick(DialogInterface dialog, int which) { for(String w : wiki) { - File fl = new File(w); + File fl = getMyApplication().getAppPath(w); File nf = new File(fl.getParentFile(), IndexConstants.BACKUP_INDEX_DIR + "/"+fl.getName()); boolean res = fl.renameTo(nf); if(!res) {