Buggy code:
public class SettingFragment extends AbstractFragment implements MotionEventListener { @ InjectView ( id . button_back ) ImageButton buttonBack ; @ InjectView ( id . muteCheckbox ) CheckBox muteCheckbox ; @ InjectView ( id . versionTextView ) TextView version ; @ InjectView ( id . authorTextView ) TextView authors ; @ InjectView ( id . creditsTextView ) TextView credits ; @ InjectView ( id . feedbackTextView ) TextView feedback ; @ Inject MotionController motionController ; @ InjectView ( id . calibration_seekbar ) SeekBar rotationSensitivity ; GameSettings currentSettings ; SettingsFileHandler settingsFileHandler ; public SettingFragment ( ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { super . onViewCreated ( view , savedInstanceState ) ; buttonBack . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { audioManager . startButtonSound ( ) ; FragmentManager fragmentManager = getFragmentManager ( ) ; fragmentManager . popBackStack ( ) ; } } ) ; muteCheckbox . setChecked ( PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) . getBoolean ( getActivity ( ) . getString ( settings_sound ) , false ) ) ; muteCheckbox . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { SharedPreferences prefs = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; SharedPreferences . Editor editor = prefs . edit ( ) ; editor . putBoolean ( getString ( settings_sound ) , ( ( CheckBox ) ( v ) ) . isChecked ( ) ) ; editor . commit ( ) ; audioManager . onResume ( getActivity ( ) ) ; } } ) ; settingsFileHandler = new SettingsFileHandler ( this . getActivity ( ) ) ; rotationSensitivity . setMax ( SENSITIVITY_MAX_VALUE ) ; try { currentSettings = new GameSettings ( settingsFileHandler . loadSettings ( ) ) ; <START_BUG> rotationSensitivity . setProgress ( ( ( int ) ( currentSettings . getRotationSensitivity ( ) ) ) ) ; <END_BUG> } catch ( JSONException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { currentSettings = new GameSettings ( ) ; } rotationSensitivity . setOnSeekBarChangeListener ( new SeekBar . OnSeekBarChangeListener ( ) { @ Override public void onProgressChanged ( SeekBar seekBar , int progress , boolean fromUser ) { currentSettings . setRotationSensitivity ( ( progress + 1 ) ) ; motionController . setMotionSettings ( currentSettings ) ; } @ Override public void onStartTrackingTouch ( SeekBar seekBar ) { } @ Override public void onStopTrackingTouch ( SeekBar seekBar ) { } } ) ; version . setText ( getVersion ( ) ) ; setOnClickDialogForTextView ( authors , about_authors_title , about_authors_msg ) ; setOnClickDialogForTextView ( credits , about_credits_title , about_credits_msg ) ; AlertDialog . Builder feedbackDialog = setOnClickDialogForTextView ( feedback , about_feedback_title , about_feedback_msg ) ; feedbackDialog . setPositiveButton ( about_feedback_ok , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { Uri uri = Uri . parse ( ( "market:////details?id=" + ( getActivity ( ) . getPackageName ( ) ) ) ) ; Intent intent = new Intent ( Intent . ACTION_VIEW , uri ) ; intent . addFlags ( ( ( ( Intent . FLAG_ACTIVITY_NO_HISTORY ) | ( Intent . FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET ) ) | ( Intent . FLAG_ACTIVITY_MULTIPLE_TASK ) ) ) ; try { startActivity ( intent ) ; } catch ( ActivityNotFoundException e ) { startActivity ( new Intent ( Intent . ACTION_VIEW , Uri . parse ( ( "http:////play.google.com//store//apps//details?id=" + ( getActivity ( ) . getPackageName ( ) ) ) ) ) ) ; } } } ) ; feedbackDialog . setNegativeButton ( about_feedback_cancel , null ) ; } private String getVersion ( ) { } private Builder setOnClickDialogForTextView ( TextView textView , final int titleResourceId , final int msgResourceId ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onDestroyView ( ) { } @ Override public void onLeftPunch ( ) { } @ Override public void onRightPunch ( ) { } @ Override public void onBlock ( ) { } }

Fix:
rotationSensitivity . setProgress ( ( ( ( int ) ( currentSettings . getRotationSensitivity ( ) ) ) - 1 ) ) ;