Buggy code:
public class GameBoard extends Activity implements OnTouchListener { private MediaPlayer mp ; private Controller c ; private static final String TAG = "GameBoard" ; static final int NONE = 0 ; static final int DRAG = 1 ; static final int ZOOM = 2 ; static final int PRESS = 3 ; int mode = GameBoard . NONE ; PointF start = new PointF ( ) ; PointF mid = new PointF ( ) ; float oldDist = 1.0F ; private GameBoardView gameBoardView ; private GUIGameValues ggvGlobal = new GUIGameValues ( ) ; private SaveGUIData sd = new SaveGUIData ( ) ; private SaveGameData saveGame = new SaveGameData ( ) ; private char p1Char ; private char p2Char ; private ArrayList < String > commands ; private boolean endTurn = false ; private boolean move = false ; private boolean aiTurn = false ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } @ Override public boolean onTouch ( View v , MotionEvent event ) { switch ( ( event . getAction ( ) ) & ( MotionEvent . ACTION_MASK ) ) { case MotionEvent . ACTION_DOWN : start . set ( event . getX ( ) , event . getY ( ) ) ; Log . d ( GameBoard . TAG , "mode=DRAG" ) ; mode = GameBoard . PRESS ; break ; case MotionEvent . ACTION_POINTER_DOWN : oldDist = spacing ( event ) ; Log . d ( GameBoard . TAG , ( "oldDist=" + ( oldDist ) ) ) ; if ( ( oldDist ) > 10.0F ) { midPoint ( mid , event ) ; mode = GameBoard . ZOOM ; Log . d ( GameBoard . TAG , "mode=ZOOM" ) ; } break ; case MotionEvent . ACTION_UP : case MotionEvent . ACTION_POINTER_UP : if ( ( mode ) == ( GameBoard . PRESS ) ) { ggvGlobal = sd . loadGGVData ( ) ; int [ ] selectedPoints = gameBoardView . getPoints ( event . getX ( ) , event . getY ( ) ) ; if ( ( ( ( move ) == true ) && ( selectedPoints != null ) ) && ( c . isValidMove ( selectedPoints [ 0 ] , selectedPoints [ 1 ] ) ) ) { c . unitMove ( selectedPoints [ 0 ] , selectedPoints [ 1 ] ) ; gameBoardView . setController ( c ) ; gameBoardView . initGame ( ) ; move = false ; } else { move = false ; if ( selectedPoints != null ) commands = c . selectCoordinates ( selectedPoints [ 0 ] , selectedPoints [ 1 ] ) ; if ( ( ( commands ) != null ) && ( ! ( commands . isEmpty ( ) ) ) ) { <START_BUG> if ( commands . get ( 0 ) . toUpperCase ( ) . equals ( "MOVE" ) ) { <END_BUG> ggvGlobal . setAvailableCommands ( commands ) ; ggvGlobal . setUnitInfo ( c . getUnitInfo ( ) ) ; Intent i = new Intent ( this , InGameMenu . class ) ; i . putExtra ( "ggv" , ggvGlobal ) ; startActivityForResult ( i , 0 ) ; commands . clear ( ) ; } else { ggvGlobal . setAvailableCommands ( commands ) ; Intent i2 = new Intent ( this , UnitSelectionMenu . class ) ; i2 . putExtra ( "ggv" , ggvGlobal ) ; startActivityForResult ( i2 , 0 ) ; } } } } mode = GameBoard . NONE ; Log . d ( GameBoard . TAG , "mode=NONE" ) ; break ; case MotionEvent . ACTION_MOVE : if ( ( ( mode ) == ( GameBoard . PRESS ) ) && ( ( ( Math . abs ( ( ( event . getX ( ) ) - ( start . x ) ) ) ) > 20 ) || ( ( Math . abs ( ( ( event . getY ( ) ) - ( start . y ) ) ) ) > 20 ) ) ) { mode = GameBoard . DRAG ; } if ( ( mode ) == ( GameBoard . DRAG ) ) { gameBoardView . translateBoard ( ( - ( ( event . getX ( ) ) - ( start . x ) ) ) , ( - ( ( event . getY ( ) ) - ( start . y ) ) ) ) ; } else if ( ( mode ) == ( GameBoard . ZOOM ) ) { float newDist = spacing ( event ) ; if ( newDist > 10.0F ) { float scale = newDist // ( oldDist ) ; gameBoardView . scaleBoard ( scale , mid . x , mid . y ) ; } } break ; } v . invalidate ( ) ; return true ; } private float spacing ( MotionEvent event ) { } private void midPoint ( PointF point , MotionEvent event ) { } }

Fix:
if ( commands . contains ( "UnitInfo" ) ) {