Buggy code:
public class Settings extends BaseActivity { static boolean isSinActive ; static boolean isCosActive ; static boolean isCscActive ; static boolean isSecActive ; static boolean isCotActive ; static boolean isTanActive ; static boolean isArcsinActive ; static boolean isArccosActive ; static boolean isArccscActive ; static boolean isArcsecActive ; static boolean isArccotActive ; static boolean isArctanActive ; static long quizDuration ; public static boolean areBlairTalksSoundsEnabled = true ; public static boolean isMusicEnabled = true ; TextView quizTimeView ; SeekBar quizTimeBar ; private String [ ] navMenuTitles ; private TypedArray navMenuIcons ; String [ ] functions = new String [ ] { "sin" , "cos" , "csc" , "sec" , "tan" , "cot" , "arcsin" , "arccos" , "arccsc" , "arcsec" , "arctan" , "arccot" } ; protected void onCreate ( Bundle savedInstanceState ) { } public static boolean isFunctionActive ( String operation ) { } private void updateFunctionStates ( ) { } public void onCheckboxClicked ( View view ) throws IOException { SharedPreferences settings = getPreferences ( MODE_PRIVATE ) ; SharedPreferences . Editor editor = settings . edit ( ) ; boolean checked = ( ( android . widget . CheckBox ) ( view ) ) . isChecked ( ) ; int numChecked = 0 ; numChecked += ( Settings . isSinActive ) ? 1 : 0 ; numChecked += ( Settings . isCosActive ) ? 1 : 0 ; numChecked += ( Settings . isTanActive ) ? 1 : 0 ; numChecked += ( Settings . isCscActive ) ? 1 : 0 ; numChecked += ( Settings . isSecActive ) ? 1 : 0 ; numChecked += ( Settings . isCotActive ) ? 1 : 0 ; numChecked += ( Settings . isArcsinActive ) ? 1 : 0 ; numChecked += ( Settings . isArccosActive ) ? 1 : 0 ; numChecked += ( Settings . isArctanActive ) ? 1 : 0 ; numChecked += ( Settings . isArccscActive ) ? 1 : 0 ; numChecked += ( Settings . isArcsecActive ) ? 1 : 0 ; numChecked += ( Settings . isArccotActive ) ? 1 : 0 ; <START_BUG> if ( ( numChecked == 1 ) && ( ! checked ) ) { <END_BUG> Toast . makeText ( this , "You<seq2seq4repair_space>must<seq2seq4repair_space>select<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>one<seq2seq4repair_space>function" , LENGTH_SHORT ) . show ( ) ; ( ( android . widget . CheckBox ) ( view ) ) . setChecked ( true ) ; return ; } switch ( view . getId ( ) ) { case id . checkbox_sin : if ( checked ) editor . putBoolean ( "isSinActive" , true ) ; else editor . putBoolean ( "isSinActive" , false ) ; break ; case id . checkbox_cos : if ( checked ) editor . putBoolean ( "isCosActive" , true ) ; else editor . putBoolean ( "isCosActive" , false ) ; break ; case id . checkbox_csc : if ( checked ) editor . putBoolean ( "isCscActive" , true ) ; else editor . putBoolean ( "isCscActive" , false ) ; break ; case id . checkbox_sec : if ( checked ) editor . putBoolean ( "isSecActive" , true ) ; else editor . putBoolean ( "isSecActive" , false ) ; break ; case id . checkbox_tan : if ( checked ) editor . putBoolean ( "isTanActive" , true ) ; else editor . putBoolean ( "isTanActive" , false ) ; break ; case id . checkbox_cot : if ( checked ) editor . putBoolean ( "isCotActive" , true ) ; else editor . putBoolean ( "isCotActive" , false ) ; break ; case id . checkbox_arcsin : if ( checked ) editor . putBoolean ( "isArcsinActive" , true ) ; else editor . putBoolean ( "isArcsinActive" , false ) ; break ; case id . checkbox_arccos : if ( checked ) editor . putBoolean ( "isArccosActive" , true ) ; else editor . putBoolean ( "isArccosActive" , false ) ; break ; case id . checkbox_arccsc : if ( checked ) editor . putBoolean ( "isArccscActive" , true ) ; else editor . putBoolean ( "isArccscActive" , false ) ; break ; case id . checkbox_arcsec : if ( checked ) editor . putBoolean ( "isArcsecActive" , true ) ; else editor . putBoolean ( "isArcsecActive" , false ) ; break ; case id . checkbox_arctan : if ( checked ) editor . putBoolean ( "isArctanActive" , true ) ; else editor . putBoolean ( "isArctanActive" , false ) ; break ; case id . checkbox_arccot : if ( checked ) editor . putBoolean ( "isArccotActive" , true ) ; else editor . putBoolean ( "isArccotActive" , false ) ; break ; case id . checkbox_blairtalks_sounds : if ( checked ) editor . putBoolean ( "areBlairTalksSoundsEnabled" , true ) ; else editor . putBoolean ( "areBlairTalksSoundsEnabled" , false ) ; break ; case id . checkbox_music : if ( checked ) { editor . putBoolean ( "isMusicEnabled" , true ) ; if ( ( speedTrigMainTheme ) != null ) { speedTrigMainTheme . prepare ( ) ; speedTrigMainTheme . start ( ) ; } else { speedTrigMainTheme = MediaPlayer . create ( this , speed_trig_main_theme ) ; speedTrigMainTheme . seekTo ( speedTrigMainThemeProgress ) ; speedTrigMainTheme . setLooping ( true ) ; speedTrigMainTheme . start ( ) ; } } else { editor . putBoolean ( "isMusicEnabled" , false ) ; speedTrigMainTheme . stop ( ) ; } break ; } editor . apply ( ) ; updateFunctionStates ( ) ; } public void reset ( View v ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public static class PlaceholderFragment extends PreferenceFragment { public PlaceholderFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } } }

Fix:
if ( ( ( ( numChecked == 1 ) && ( ! checked ) ) && ( ( view . getId ( ) ) != ( id . checkbox_blairtalks_sounds ) ) ) && ( ( view . getId ( ) ) != ( id . checkbox_music ) ) ) {