Fixed deprecated Handler constructor

This commit is contained in:
luca0N! 2021-03-17 16:19:16 -03:00
parent 8b2bd0522c
commit dc554eca2a
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper;
import android.net.Uri; import android.net.Uri;
import android.view.View; import android.view.View;
import android.view.MenuItem; import android.view.MenuItem;
@ -293,7 +294,7 @@ public class TriviaGameActivity extends BaseActivity
SoundUtil.playSound(this, guess ? SoundUtil.playSound(this, guess ?
SoundUtil.SOUND_ANSWER_CORRECT : SoundUtil.SOUND_ANSWER_WRONG); SoundUtil.SOUND_ANSWER_CORRECT : SoundUtil.SOUND_ANSWER_WRONG);
new Handler().postDelayed(() -> { new Handler(Looper.getMainLooper()).postDelayed(() -> {
if (game.isDone()) { if (game.isDone()) {
Intent intent = new Intent(getApplicationContext(), TriviaGameResultsActivity.class); Intent intent = new Intent(getApplicationContext(), TriviaGameResultsActivity.class);
intent.putExtra(TriviaGameResultsActivity.EXTRA_TRIVIA_GAME, game); intent.putExtra(TriviaGameResultsActivity.EXTRA_TRIVIA_GAME, game);