From 287f2dae4a5cd61901d1c81dfc81a51364abaf6e Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sat, 21 Mar 2020 17:35:44 +0100 Subject: [PATCH] Minor cleanup --- .../droidfish/activities/EditFilePreference.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditFilePreference.java b/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditFilePreference.java index 7d07896..f698e7a 100644 --- a/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditFilePreference.java +++ b/DroidFishApp/src/main/java/org/petero/droidfish/activities/EditFilePreference.java @@ -115,10 +115,9 @@ public class EditFilePreference extends EditTextPreference { currentPath = newPath; } - final String action = FileBrowseUtil.getPickAction(pickDirectory); - final String title = getContext().getString(pickDirectory ? R.string.select_directory - : R.string.select_file); - Intent i = new Intent(action); + String title = getContext().getString(pickDirectory ? R.string.select_directory + : R.string.select_file); + Intent i = new Intent(FileBrowseUtil.getPickAction(pickDirectory)); i.setData(Uri.fromFile(new File(currentPath))); i.putExtra("org.openintents.extra.TITLE", title); try { @@ -140,9 +139,8 @@ public class EditFilePreference extends EditTextPreference { private boolean matchPattern(String s) { if (ignorePattern.isEmpty()) return false; - Pattern p; try { - p = Pattern.compile(ignorePattern); + Pattern p = Pattern.compile(ignorePattern); return p.matcher(s).find(); } catch (PatternSyntaxException ex) { return false;