This commit is contained in:
Dennis Guse
2019-09-02 18:02:43 +02:00
parent c551a38a8b
commit 0a046fc100
3 changed files with 12 additions and 12 deletions
@@ -46,7 +46,7 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
private String directoryDisplayName; private String directoryDisplayName;
private SaveAsyncTask saveAsyncTask; private ExportAsyncTask exportAsyncTask;
private ProgressDialog progressDialog; private ProgressDialog progressDialog;
// the number of tracks successfully saved // the number of tracks successfully saved
@@ -81,14 +81,14 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
directoryDisplayName = FileUtils.getPathDisplayName(trackFileFormat.getExtension()); directoryDisplayName = FileUtils.getPathDisplayName(trackFileFormat.getExtension());
//TODO (still needed?): getLastNonConfiguration instance returned SaveAsyncTask before //TODO (still needed?): getLastNonConfiguration instance returned ExportAsyncTask before
// Object retained = getLastNonConfigurationInstance(); // Object retained = getLastNonConfigurationInstance();
// if (retained instanceof SaveAsyncTask) { // if (retained instanceof ExportAsyncTask) {
// saveAsyncTask = (SaveAsyncTask) retained; // exportAsyncTask = (ExportAsyncTask) retained;
// saveAsyncTask.setActivity(this); // exportAsyncTask.setActivity(this);
// } else { // } else {
saveAsyncTask = new SaveAsyncTask(this, trackFileFormat, directory); exportAsyncTask = new ExportAsyncTask(this, trackFileFormat, directory);
saveAsyncTask.execute(); exportAsyncTask.execute();
// } // }
} }
@@ -106,7 +106,7 @@ public class ExportActivity extends FragmentActivity implements FileTypeDialogFr
new DialogInterface.OnCancelListener() { new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
saveAsyncTask.cancel(true); exportAsyncTask.cancel(true);
dialog.dismiss(); dialog.dismiss();
onDismissed(); onDismissed();
} }
@@ -42,9 +42,9 @@ import de.dennisguse.opentracks.util.SystemUtils;
* @author Jimmy Shih * @author Jimmy Shih
*/ */
//TODO Make independent from ExportActivity? //TODO Make independent from ExportActivity?
public class SaveAsyncTask extends AsyncTask<Void, Integer, Boolean> { public class ExportAsyncTask extends AsyncTask<Void, Integer, Boolean> {
private static final String TAG = SaveAsyncTask.class.getSimpleName(); private static final String TAG = ExportAsyncTask.class.getSimpleName();
private final TrackFileFormat trackFileFormat; private final TrackFileFormat trackFileFormat;
private final File directory; private final File directory;
private final Context context; private final Context context;
@@ -71,7 +71,7 @@ public class SaveAsyncTask extends AsyncTask<Void, Integer, Boolean> {
* @param trackFileFormat the track file format * @param trackFileFormat the track file format
* @param directory the directory to write the file * @param directory the directory to write the file
*/ */
public SaveAsyncTask(ExportActivity exportActivity, TrackFileFormat trackFileFormat, File directory) { public ExportAsyncTask(ExportActivity exportActivity, TrackFileFormat trackFileFormat, File directory) {
this.exportActivity = exportActivity; this.exportActivity = exportActivity;
this.trackFileFormat = trackFileFormat; this.trackFileFormat = trackFileFormat;
this.directory = directory; this.directory = directory;
@@ -84,7 +84,7 @@ public class ImportActivity extends FragmentActivity implements FileTypeDialogFr
return; return;
} }
//TODO (still needed?): getLastNonConfiguration instance returned SaveAsyncTask before //TODO (still needed?): getLastNonConfiguration instance returned ExportAsyncTask before
// Object retained = getLastNonConfigurationInstance(); // Object retained = getLastNonConfigurationInstance();
// if (retained instanceof ImportAsyncTask) { // if (retained instanceof ImportAsyncTask) {
// importAsyncTask = (ImportAsyncTask) retained; // importAsyncTask = (ImportAsyncTask) retained;