diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-04-20 20:16:40 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-04-20 22:14:19 +0200 |
| commit | b9b297a38accdd54641b325ece04f488bbf90fb8 (patch) | |
| tree | 5ab47eb0f713148a86a03d7c14ee2223acbfb396 /main/src/cgeo/geocaching/files/FileList.java | |
| parent | c91a817d13a8f68cc5b7399ba4cbe7cd16a4645b (diff) | |
| download | cgeo-b9b297a38accdd54641b325ece04f488bbf90fb8.zip cgeo-b9b297a38accdd54641b325ece04f488bbf90fb8.tar.gz cgeo-b9b297a38accdd54641b325ece04f488bbf90fb8.tar.bz2 | |
Refactoring: cleanup control flow
Diffstat (limited to 'main/src/cgeo/geocaching/files/FileList.java')
| -rw-r--r-- | main/src/cgeo/geocaching/files/FileList.java | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/main/src/cgeo/geocaching/files/FileList.java b/main/src/cgeo/geocaching/files/FileList.java index 576aa2c..48a98a7 100644 --- a/main/src/cgeo/geocaching/files/FileList.java +++ b/main/src/cgeo/geocaching/files/FileList.java @@ -63,30 +63,14 @@ public abstract class FileList<T extends ArrayAdapter<File>> extends AbstractLis @Override public void handleMessage(Message msg) { - try { - if (CollectionUtils.isEmpty(files)) { - if (waitDialog != null) { - waitDialog.dismiss(); - } - - showToast(res.getString(R.string.file_list_no_files)); - - finish(); - return; - } else { - if (adapter != null) { - adapter.notifyDataSetChanged(); - } - } - - if (waitDialog != null) { - waitDialog.dismiss(); - } - } catch (Exception e) { - if (waitDialog != null) { - waitDialog.dismiss(); - } - Log.e("cgFileList.loadFilesHandler: " + e.toString()); + if (waitDialog != null) { + waitDialog.dismiss(); + } + if (CollectionUtils.isEmpty(files)) { + showToast(res.getString(R.string.file_list_no_files)); + finish(); + } else if (adapter != null) { + adapter.notifyDataSetChanged(); } } }; |
