OSDN Git Service

am 04b646df: Merge "Possible NumberFormatException of parseInt is outside try-catch"
authorJean-Baptiste Queru <jbq@google.com>
Tue, 30 Nov 2010 00:11:16 +0000 (16:11 -0800)
committerAndroid Git Automerger <android-git-automerger@android.com>
Tue, 30 Nov 2010 00:11:16 +0000 (16:11 -0800)
* commit '04b646df1e9f00719d2d547fa1da59407bb6be67':
  Possible NumberFormatException of parseInt is outside try-catch

src/com/android/settings/SoundSettings.java

index a735268..2984684 100644 (file)
@@ -318,8 +318,8 @@ public class SoundSettings extends PreferenceActivity implements
     public boolean onPreferenceChange(Preference preference, Object objValue) {
         final String key = preference.getKey();
         if (KEY_EMERGENCY_TONE.equals(key)) {
-            int value = Integer.parseInt((String) objValue);
             try {
+                int value = Integer.parseInt((String) objValue);
                 Settings.System.putInt(getContentResolver(),
                         Settings.System.EMERGENCY_TONE, value);
             } catch (NumberFormatException e) {