Browse Source

Ensuring that bookmark export failures are handled

master
anthony restaino 8 years ago
parent
commit
bee7d4b8dd
  1. 11
      app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java
  2. 1
      app/src/main/res/values/strings.xml

11
app/src/main/java/acr/browser/lightning/fragment/BookmarkSettingsFragment.java

@ -211,6 +211,17 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref @@ -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);
}
}
});
}
});

1
app/src/main/res/values/strings.xml

@ -176,6 +176,7 @@ @@ -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>

Loading…
Cancel
Save