LibreTrivia
LibreTrivia copied to clipboard
how to set TriviaDifficulty programmable ?
how to set TriviaDifficulty programmable ? like i want as
String resultDifficulty = ""; if (datapoints<=200 ){ resultDifficulty = "EASY"; } if (datapoints>201 ){ resultDifficulty = "MEDIUM"; } if (datapoints>=500 ){ resultDifficulty = "HARD"; }
but wen use this as
TriviaQuery query = new TriviaQuery.Builder(amount) .category(TriviaCategory.GENERAL_KNOWLEDGE) //.difficulty(TriviaDifficulty.EASY) .difficulty(resultDifficulty) .build();
. get error as
Will you help me ?
I think resultDifficulty of the wrong type and it should be something like TriviaDifficulty.EASY
(of type TriviaDifficulty
) instead of the string "EASY"
.