use of net.osmand.plus.settings.backend.backup.ImportFileTask in project Osmand by osmandapp.
the class FileImportDuplicatesFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
settingsHelper = app.getFileSettingsHelper();
ImportFileTask importTask = settingsHelper.getImportTask();
if (importTask != null) {
if (settingsItems == null) {
settingsItems = importTask.getSelectedItems();
}
if (duplicatesList == null) {
duplicatesList = importTask.getDuplicates();
}
if (file == null) {
file = importTask.getFile();
}
Fragment target = getTargetFragment();
if (target instanceof ImportSettingsFragment) {
ImportListener importListener = ((ImportSettingsFragment) target).getImportListener();
importTask.setImportListener(importListener);
}
}
}
use of net.osmand.plus.settings.backend.backup.ImportFileTask in project Osmand by osmandapp.
the class FileImportSettingsFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
exportMode = false;
settingsHelper = app.getFileSettingsHelper();
ImportFileTask importTask = settingsHelper.getImportTask();
if (importTask != null) {
if (settingsItems == null) {
settingsItems = importTask.getItems();
}
if (file == null) {
file = importTask.getFile();
}
List<Object> duplicates = importTask.getDuplicates();
List<SettingsItem> selectedItems = importTask.getSelectedItems();
if (duplicates == null) {
importTask.setDuplicatesListener(getDuplicatesListener());
} else if (duplicates.isEmpty() && selectedItems != null && file != null) {
settingsHelper.importSettings(file, selectedItems, "", 1, getImportListener());
}
}
}
Aggregations