0

クラスで単純なスレッドを呼び出しますが、それを呼び出すとアプリケーションがクラッシュします。これはスレッドです:

private void startGame() {
    new Thread(new Runnable() {
        public void run() {
            while (isGiocoAttivo()) {
                try {
                    Thread.sleep(velocitaDiGioco);
                    accendiBomba();
                } catch (InterruptedException ex) {
                }
            }

        }
    }).start();
}

どうすれば解決できますか?メソッド accendiBomba:

private void accendiBomba() {
    try {
        do {
            this.x = (int) Math.round(Math.random() * (righe - 1));
            this.y = (int) Math.round(Math.random() * (colonne - 1));
        } while (!this.action(this.x, this.y));
    } catch (CampoException ex) {
    }
}
4

1 に答える 1