aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-10-11 21:17:22 -0700
committerScott Jackson <daneren2005@gmail.com>2014-10-11 21:17:22 -0700
commite90c3a82edc5f4518918839d66d310b4a3dc524d (patch)
tree0a78e820a2a5ae065a4e9805c6177384288474bc
parentec0e1376d0dc639fcee174117b1728709a07063a (diff)
downloaddsub-e90c3a82edc5f4518918839d66d310b4a3dc524d.tar.gz
dsub-e90c3a82edc5f4518918839d66d310b4a3dc524d.tar.bz2
dsub-e90c3a82edc5f4518918839d66d310b4a3dc524d.zip
Add error handling for parseInt
-rw-r--r--src/github/daneren2005/dsub/view/SeekBarPreference.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/view/SeekBarPreference.java b/src/github/daneren2005/dsub/view/SeekBarPreference.java
index dedea908..e96d76f8 100644
--- a/src/github/daneren2005/dsub/view/SeekBarPreference.java
+++ b/src/github/daneren2005/dsub/view/SeekBarPreference.java
@@ -98,8 +98,12 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
* @return A string representation of the threshold.
*/
private String getSummary(String value) {
- int val = Integer.parseInt(value);
- return String.format(mDisplay, (val + mMin) / mStepSize);
+ try {
+ int val = Integer.parseInt(value);
+ return String.format(mDisplay, (val + mMin) / mStepSize);
+ } catch (Exception e) {
+ return "";
+ }
}
@Override