Created
September 27, 2016 05:03
-
-
Save geniushkg/bfd67417e4596d52a25ab862d594bdec to your computer and use it in GitHub Desktop.
sample gist to filter content from retrofit response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is retrofit response | |
Eventlist eventlist = response.body(); | |
List<Website> websites = eventlist.getWebsites(); // website is POJO class for even as per api | |
List<Website> filteredWebsite = new ArrayList<Website>(); // empty list new | |
for(Website temp:websites){ | |
if(temp.getCategory().equalsIgnoreCase(sortType.name())){ | |
filteredWebsite.add(temp); // sortType.name() is BOT or Competitive or whichever selected | |
} | |
} | |
// then put new filteredwebsite data on ui recycler view list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment