Closed nmalsabah closed 11 months ago
I figured out the issue. I was setting the text for the radio buttons as an integer value but it required a string. I had to convert the integer to a string in the last line of code in this method:
private void displayTriviaQuestions() {
List
for (int j = 0; j < triviaQuestionsRadioGroups.get(i).getChildCount(); j++) {
RadioButton radioButton = (RadioButton) triviaQuestionsRadioGroups.get(i).getChildAt(j);
// Convert the integer to a string before setting it
radioButton.setText(String.valueOf(triviaQuestions.get(i).getTriviaAnswer(j)));
}
}
This has been resolved.
Issue:
The user clicks the "Play Game" button from their landing page. The app is suppose to launch the TriviaGameActivity and start the game but instead it keeps going back to the user's landing page. To debug I need to make sure the userId is being set correctly.
Debug:
private void launchUserLandingPageActivity() { int userId = user.getUserId(); // Ensure this returns a valid value Log.d("LoginActivity", "Launching UserLandingPageActivity with userId: " + userId);
}
Log Message:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.startrek_triviagame/com.example.startrek_triviagame.TriviaGameActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x1