Buggy code:
public class GameEngine implements OnDialogButtonClickListener , OnGameTimeUpdateListener , Serializable { public static final int STANDOFF = 0 ; public static final int PLAYER1 = 1 ; public static final int PLAYER2 = 2 ; private transient View rootView ; private transient TextView tvCardQuantityP1 ; private transient TextView tvCardQuantityP2 ; private transient TextView tvCurPlayer ; private transient TextView tvTimeoutLeft ; private transient TextView tvRoundsLeft ; private transient TextView tvPointsLeft ; private transient TextView tvTimeLeft ; private transient LinearLayout linLayoutRound ; private transient LinearLayout linLayoutPoints ; private transient LinearLayout linLayoutTime ; private transient ProgressBar pbBalance ; private transient ProgressBar pbTimeout ; private transient CardFragment cardFragment ; private transient GameActivity gameActivity ; private transient Context context ; private transient FragmentManager fragmentManager ; private transient SoftKiTask softKiTask ; private transient MediumKiTask mediumKiTask ; private transient HardKiTask hardKiTask ; private transient PlayerTimeOutTask playerTimeOutTask ; private transient GameTimeTask gameTimeTask ; private transient KiPlaysDialog kiPlaysDialog ; private int curPlayer = 0 ; private int playerWonRound = 0 ; private Player p1 ; private Player p2 ; private final OfflineDeck gameDeck ; private GameMode gameMode ; private Timestamp startTime = null ; private Timestamp lastPlayed = null ; private int curRound = 0 ; private long curTime = 0 ; private int maxRounds = 0 ; private int maxPoints = 0 ; private int gameTime = 0 ; private int timeout = 0 ; private KILevel kiLevel ; private boolean isMagicMode = false ; private boolean isMultiplayer = false ; private boolean hasPlayerTimeout = false ; private boolean hasMaxRounds = false ; private boolean isAdditionalRound = false ; private ArrayList < Card > stingStack ; private boolean gameover = false ; private CardController cardCtrl ; private PlayerController playerCtrl ; private StatisticController statisticCtrl ; public GameEngine ( Context context , OfflineDeck gameDeck ) { } public GameEngine ( GameActivity gameActivity , Context context , View rootView , Bundle args ) { } private void initialiseGame ( ) { } public void initialisePlayers ( String p1Name , String p2Name ) { } private void initialiseUi ( View v ) { } private void initialiseCtrl ( ) { } public void startGame ( ) { } private void finishGame ( int playerWonGame ) { } public void stop ( ) { } private void stopAllTasks ( ) { } public void stopKiTasks ( ) { if ( ( softKiTask ) != null ) softKiTask . cancel ( true ) ; if ( ( mediumKiTask ) != null ) mediumKiTask . cancel ( true ) ; if ( ( hardKiTask ) != null ) <START_BUG> mediumKiTask . cancel ( true ) ; <END_BUG> } private void stopPlayerTimeoutTask ( ) { } private void stopGameTimeTask ( ) { } public void startKiTask ( ) { } public void handleCardAttrSelect ( CardAttribute cardAttribute ) { } public void startNextRound ( ) { } public void showCurrentPlayerCard ( ) { } public void handleBalance ( ) { } public void handlePlayerTimeout ( ) { } private void initialisePlayerTimeout ( ) { } public void handleToolbarInfo ( ) { } public void showRoundEndDialog ( CardAttribute cardAttribute , int playerWonRound ) { } public void showGameEndDialog ( int playerWon ) { } public void showPlayerChangedDialog ( Player player ) { } @ Override public void OnDialogPositiveClick ( DialogFragment dialog ) { } @ Override public void OnDialogNevativeClick ( DialogFragment dialog ) { } @ Override public void OnDialogNeutralClick ( DialogFragment dialog ) { } @ Override public void onGameTimeUpdate ( long time ) { } @ Override public void onTimeoutUpdate ( long time ) { } public int getGameTime ( ) { } public long getCurTime ( ) { } public boolean getHasMaxRounds ( ) { } public int getCurRound ( ) { } public void increaseMaxRounds ( ) { } public boolean isMagicMode ( ) { } public boolean isMultiplayer ( ) { } public int getTimeout ( ) { } public int getMaxRounds ( ) { } public int getCurPlayer ( ) { } public Player getP1 ( ) { } public Player getP2 ( ) { } public Player getPlayer ( int playerId ) { } public ArrayList < Card > getStingStack ( ) { } public GameMode getGameMode ( ) { } public int getMaxPoints ( ) { } public Context getContext ( ) { } public Timestamp getLastPlayed ( ) { } public KILevel getKiLevel ( ) { } public OfflineDeck getGameDeck ( ) { } public boolean isGameOver ( ) { } public GameActivity getGameActivity ( ) { } public void updateLastPlayed ( ) { } public void setStingStack ( ArrayList < Card > stingStack ) { } public void setCurPlayer ( int curPlayer ) { } public void setContext ( Context context ) { } public void setFragmentManager ( FragmentManager fragmentManager ) { } public void setRootView ( View rootView ) { } public void setGameActivity ( GameActivity gameActivity ) { } }

Fix:
hardKiTask . cancel ( true ) ;