diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-10-11 21:17:22 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-10-11 21:17:22 -0700 |
commit | e90c3a82edc5f4518918839d66d310b4a3dc524d (patch) | |
tree | 0a78e820a2a5ae065a4e9805c6177384288474bc | |
parent | ec0e1376d0dc639fcee174117b1728709a07063a (diff) | |
download | dsub-e90c3a82edc5f4518918839d66d310b4a3dc524d.tar.gz dsub-e90c3a82edc5f4518918839d66d310b4a3dc524d.tar.bz2 dsub-e90c3a82edc5f4518918839d66d310b4a3dc524d.zip |
Add error handling for parseInt
-rw-r--r-- | src/github/daneren2005/dsub/view/SeekBarPreference.java | 8 |
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
|