Buggy code:
public class MainActivity extends FragmentActivity { private ViewGroup mPadLayout ; private ViewGroup mConsoleLayout ; private ExternalData data = new ExternalData ( ) ; private Point p ; private List < String > item = null ; private List < String > path = null ; private String root = ( Environment . getExternalStorageDirectory ( ) ) + "//PhatLab//" ; private String currSamp ; private String currPad = "" ; private TextView pNum = null ; private Spinner fSpin = null ; private PhatTracks pads = null ; private int [ ] [ ] pGrid = null ; SequenceTimer sequence ; int maxBeat ; int currentBeat ; int loopLength ; boolean loopOn ; PhatPadFragment phatPadFragment = new PhatPadFragment ( ) ; SequencerFragment sequencerFragment = new SequencerFragment ( ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; requestWindowFeature ( FEATURE_NO_TITLE ) ; setContentView ( activity_main ) ; FragmentManager fm = getFragmentManager ( ) ; <START_BUG> sequence = new SequenceTimer ( 360 , 8 ) ; <END_BUG> sequence . setPlayTime ( 0 , 0 , ( - 1 ) , ( - 1 ) ) ; PCM sample1 = new ExternalData ( ) . loadPCM ( "amen_kick1" ) ; PCM sample2 = new ExternalData ( ) . loadPCM ( "amen_snare1" ) ; maxBeat = 1 ; currentBeat = 0 ; loopLength = 0 ; loopOn = false ; sequence . setSample ( sample1 , 0 ) ; sequence . setSample ( sample2 , 1 ) ; if ( savedInstanceState == null ) { mPadLayout = ( ( ViewGroup ) ( findViewById ( activity_main_phat_pad_container ) ) ) ; if ( ( mPadLayout ) != null ) { getSupportFragmentManager ( ) . beginTransaction ( ) . add ( activity_main_phat_pad_container , phatPadFragment ) . commit ( ) ; getSupportFragmentManager ( ) . beginTransaction ( ) . add ( activity_main_phat_pad_container , sequencerFragment ) . commit ( ) ; FragmentTransaction ft = getSupportFragmentManager ( ) . beginTransaction ( ) ; ft . hide ( sequencerFragment ) ; ft . commit ( ) ; } mConsoleLayout = ( ( ViewGroup ) ( findViewById ( activity_main_console_container ) ) ) ; if ( ( mConsoleLayout ) != null ) { ConsoleFragment consoleFragment = new ConsoleFragment ( ) ; FragmentTransaction fragmentTransaction = getSupportFragmentManager ( ) . beginTransaction ( ) ; fragmentTransaction . replace ( mConsoleLayout . getId ( ) , consoleFragment , ConsoleFragment . class . getName ( ) ) ; fragmentTransaction . commit ( ) ; } } } public void swapFrag ( String frag ) { } @ Override public void onStart ( ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onSaveInstanceState ( Bundle outState ) { } @ Override public void onStop ( ) { } @ Override public void onDestroy ( ) { } public void getDir ( String dirPath ) { } public List < String > getItems ( ) { } public int getCurBeat ( ) { } public int getMaxBeat ( ) { } public int changeMax ( String c ) { } public int changeCur ( String c ) { } public void setTextView ( TextView v ) { } public void setText ( String s ) { } public String getCurrPad ( ) { } public void setSpin ( Spinner s ) { } public void setSel ( String s ) { } public void setCurrSamp ( String s ) { } public void setTracks ( PhatTracks pT ) { } public void setGrid ( int [ ] [ ] g ) { } public void loadTrack ( String pad , String samp ) { } public void loadTrack ( int r , int c , String samp ) { } public void loadTrack ( PhatTracks t , int r , int c , String samp , int [ ] [ ] m ) { } }

Fix:
sequence = new SequenceTimer ( 180 , 8 ) ;