Ensuring that bookmark export failures are handled

This commit is contained in:
anthony restaino 2017-06-06 20:26:31 -04:00
parent 3711f81bd1
commit bee7d4b8dd
2 changed files with 12 additions and 0 deletions

View File

@ -211,6 +211,17 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
+ ' ' + exportFile.getPath());
}
}
@Override
public void onError(@NonNull Throwable throwable) {
Log.e(TAG, "onError: exporting bookmarks", throwable);
Activity activity = getActivity();
if (activity != null) {
Utils.createInformativeDialog(activity, R.string.title_error, R.string.bookmark_export_failure);
} else {
Utils.showToast(mApplication, R.string.bookmark_export_failure);
}
}
});
}
});

View File

@ -176,6 +176,7 @@
<string name="export_bookmarks">Export bookmarks to backup</string>
<string name="import_backup">Import bookmarks from backup</string>
<string name="bookmark_export_path">Bookmarks exported to</string>
<string name="bookmark_export_failure">Sorry, bookmarks could not be exported!</string>
<string name="bookmark_settings">Bookmark Settings</string>
<string name="import_bookmark_error">Could not import bookmarks from file</string>
<string name="title_chooser">Choose a file</string>