This commit is contained in:
madwasp79 2019-02-21 18:01:27 +02:00
parent b4c61ae254
commit 4097cb587d
2 changed files with 3 additions and 13 deletions

View file

@ -22,6 +22,7 @@ import android.support.v7.widget.ListPopupWindow;
import android.support.v7.widget.SwitchCompat;
import android.text.SpannableString;
import android.text.style.StyleSpan;
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
@ -958,6 +959,7 @@ public class GpxUiHelper {
final File f = new File(dir, fname);
GPXFile res = GPXUtilities.loadGPXFile(f);
if (res.error != null && res.error.getMessage().length() > 0) {
Log.d("GpxUiHelper", res.error.getMessage() + "\n");
w += res.error.getMessage() + "\n";
}
result[k++] = res;

View file

@ -40,22 +40,10 @@ public class ShowHideGpxTracksAction extends QuickAction {
} else {
selectedGpxHelper.restoreSelectedGpxFiles();
final OsmandSettings setting = activity.getMyApplication().getSettings();
final File dir = activity.getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR);
CallbackWithObject<GPXFile[]> callbackWithObject = new CallbackWithObject<GPXFile[]>() {
@Override
public boolean processResult(GPXFile[] result) {
for (GPXFile g : result) {
if (g.showCurrentTrack) {
if (!setting.SAVE_TRACK_TO_GPX.get()
&& !setting.SAVE_GLOBAL_TRACK_TO_GPX.get()) {
Toast.makeText(activity,
R.string.gpx_monitoring_disabled_warn, Toast.LENGTH_LONG)
.show();
}
break;
}
}
return true;
}
};
@ -64,7 +52,7 @@ public class ShowHideGpxTracksAction extends QuickAction {
.getSelectedGPXFiles();
List<String> files = new ArrayList<>();
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
files.add(file.getGpxFile().path);
files.add(file.getGpxFile().path.substring(file.getGpxFile().path.lastIndexOf("/")));
}
GpxUiHelper.loadFileInDifferentThread(activity, callbackWithObject, dir,