forked from upstream-mirrors/OpenTracks
Fix issue 679.
This commit is contained in:
@@ -116,7 +116,7 @@ public class ImportAllTracks {
|
|||||||
Log.i(Constants.TAG, "ImportAllTracks: Releasing wake lock.");
|
Log.i(Constants.TAG, "ImportAllTracks: Releasing wake lock.");
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.runOnUiThread(new Thread() {
|
activity.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
showDoneDialog();
|
showDoneDialog();
|
||||||
@@ -219,7 +219,7 @@ public class ImportAllTracks {
|
|||||||
* Attempts to import a GPX file. Returns true on success, issues error
|
* Attempts to import a GPX file. Returns true on success, issues error
|
||||||
* notifications and returns false on failure.
|
* notifications and returns false on failure.
|
||||||
*/
|
*/
|
||||||
private boolean importFile(File gpxFile, MyTracksProviderUtils providerUtils) {
|
private boolean importFile(final File gpxFile, MyTracksProviderUtils providerUtils) {
|
||||||
Log.i(Constants.TAG, "ImportAllTracks: importing: " + gpxFile.getName());
|
Log.i(Constants.TAG, "ImportAllTracks: importing: " + gpxFile.getName());
|
||||||
try {
|
try {
|
||||||
importedTrackIds = GpxImporter.importGPXFile(new FileInputStream(gpxFile), providerUtils);
|
importedTrackIds = GpxImporter.importGPXFile(new FileInputStream(gpxFile), providerUtils);
|
||||||
@@ -234,8 +234,13 @@ public class ImportAllTracks {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.w(Constants.TAG, "Error reading file: " + gpxFile.getAbsolutePath(), e);
|
Log.w(Constants.TAG, "Error reading file: " + gpxFile.getAbsolutePath(), e);
|
||||||
}
|
}
|
||||||
Toast.makeText(activity, activity.getString(R.string.import_error, gpxFile.getName()),
|
activity.runOnUiThread(new Runnable() {
|
||||||
Toast.LENGTH_LONG).show();
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Toast.makeText(activity, activity.getString(R.string.import_error, gpxFile.getName()),
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user