Closed sakibguy closed 1 year ago
Checked oddsWords = liveWords. If same then initialized ModelLive class to hold all values it needed to render on UI.
Logic
if (oddsWords.size() == liveWords.size()){ Log.d(TAG, "size: ="); }
Init part
if (oddsWords.size() == liveWords.size()){ Log.d(TAG, "size: =");
// String leagueName, String team1Name, String team2Name, String score, String game_id, String home_od, String draw_od, String away_od, String handicap, String over_od, String under_od
modelLives.add(new ModelLive(
"" + liveWords.get(index).getLeagueName(),
"" + liveWords.get(index).getTeam1Name(),
"" + liveWords.get(index).getTeam2Name(),
"" + liveWords.get(index).getScore(),
"" + liveWords.get(index).getGameId(),
"" + oddsWords.get(index).getHome_od(),
"" + oddsWords.get(index).getDraw_od(),
"" + oddsWords.get(index).getAway_od(),
"" + oddsWords.get(index).getHandicap(),
"" + oddsWords.get(index).getOver_od(),
"" + oddsWords.get(index).getUnder_od()
));
// keyboard Clear the adapter of previous earthquake data
adapter.clear();
// If there is a valid list of {@link Earthquake}s, then add them to the adapter's
// data set. This will trigger the ListView to update.
if (modelLives != null && !modelLives.isEmpty()) {
// mAdapter.addAll(earthquakes); // Blink "No earthquakes found."
adapter.addAll(modelLives);
}
}
##
## Snap
![1](https://user-images.githubusercontent.com/24685590/184166481-1834f4cb-3f49-4f14-8c16-a9e0342df774.PNG)
From above logical mistake detected on initialization. Init called only once!
Render issue on UI when complex api query
All data received 1 time api call
attention 1 (called muti times api/endpoints)
attention 2 (err)
Code snippets nested complex api call