Buggy code:
@ TargetApi ( VERSION_CODES . GINGERBREAD ) public class MainActivity extends ActionBarActivity { int chan ; int hauto ; File filepath ; String [ ] filelist ; yvHRTF hrtf ; Button openbut ; Button stopbut ; Button applybut ; Button funcbut ; Button setbufbut ; ToggleButton playtb ; ToggleButton autotb ; ToggleButton enctb ; EditText xtext ; EditText ytext ; EditText ztext ; EditText buftext ; String funcs = "x=cos(t)<seq2seq4repair_space>0<seq2seq4repair_space>3600\ny=0<seq2seq4repair_space>0<seq2seq4repair_space>3600\nz=sin(t)<seq2seq4repair_space>0<seq2seq4repair_space>3600" ; double parseDouble ( String s ) { } Handler TurningHandler = new Handler ( ) { public void handleMessage ( Message msg ) { } private void ProcessExpr ( double pos , String Expression ) { } private String Eval ( String Expression ) { } } ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void SetBufClick ( View v ) { } public void OpenClick ( View v ) { String [ ] list = filepath . list ( ) ; if ( list == null ) list = new String [ 0 ] ; if ( ! ( filepath . getPath ( ) . equals ( "//" ) ) ) { filelist = new String [ ( list . length ) + 1 ] ; filelist [ 0 ] = ".." ; System . arraycopy ( list , 0 , filelist , 1 , list . length ) ; } else filelist = list ; new AlertDialog . Builder ( this ) . setTitle ( "Choose<seq2seq4repair_space>a<seq2seq4repair_space>file<seq2seq4repair_space>to<seq2seq4repair_space>play" ) . setItems ( filelist , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { File sel ; if ( filelist [ which ] . equals ( ".." ) ) sel = filepath . getParentFile ( ) ; else sel = new File ( filepath , filelist [ which ] ) ; if ( sel . isDirectory ( ) ) { filepath = sel ; OpenClick ( null ) ; } else { String file = sel . getPath ( ) ; if ( autotb . isChecked ( ) ) <START_BUG> StopAuto ( ) ; <END_BUG> if ( enctb . isChecked ( ) ) StopEncode ( ) ; if ( ! ( BASS . BASS_StreamFree ( chan ) ) ) BASS . BASS_MusicFree ( chan ) ; if ( ( ( chan = BASS . BASS_StreamCreateFile ( file , 0 , 0 , BASS_SAMPLE_LOOP ) ) == 0 ) && ( ( chan = BASS . BASS_MusicLoad ( file , 0 , 0 , ( ( BASS . BASS_SAMPLE_LOOP ) | ( BASS . BASS_MUSIC_RAMP ) ) , 1 ) ) == 0 ) ) { openbut . setText ( "Open" ) ; playtb . setEnabled ( false ) ; playtb . setChecked ( false ) ; stopbut . setEnabled ( false ) ; applybut . setEnabled ( false ) ; autotb . setEnabled ( false ) ; enctb . setEnabled ( false ) ; return ; } openbut . setText ( file ) ; playtb . setEnabled ( true ) ; playtb . setChecked ( true ) ; stopbut . setEnabled ( true ) ; applybut . setEnabled ( true ) ; autotb . setEnabled ( true ) ; enctb . setEnabled ( true ) ; hrtf = new yvHRTF ( chan ) ; ApplyClick ( null ) ; hrtf . Start3D ( ) ; BASS . BASS_ChannelPlay ( chan , false ) ; } } } ) . show ( ) ; } public void PlayClick ( View v ) { } public void StopClick ( View v ) { } public void ApplyClick ( View v ) { } public void AutoClick ( View v ) { } public void FuncClick ( View v ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public void StartAuto ( ) { } public void StopAuto ( ) { } public void StartEncode ( ) { } public void StopEncode ( ) { } public void EncodeClick ( View v ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } public static class PlaceholderFragment extends Fragment { public PlaceholderFragment ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } } }

Fix:
autotb . setChecked ( false ) ;