Added handler for FileHasNoContent exception, some clean up

This commit is contained in:
Daniel Haß
2014-03-03 09:35:05 +01:00
parent 7f384e7346
commit 9843bafafd

View File

@@ -219,14 +219,21 @@ public class ImportKeysListFragment extends ListFragment implements
} else {
setListShownNoAnimation(true);
}
Exception error = data.getError();
switch (loader.getId()) {
case LOADER_ID_BYTES:
error = data.getError();
if(error instanceof ImportKeysListLoader.FileHasNoContent) {
AppMsg.makeText(getActivity(), R.string.error_import_file_no_content,
AppMsg.STYLE_ALERT).show();
}
break;
case LOADER_ID_SERVER_QUERY:
Exception error = data.getError();
if(error == null) {
AppMsg.makeText(
getActivity(), getResources().getQuantityString(R.plurals.keys_found,