Skip to content

Instantly share code, notes, and snippets.

@geniushkg
Created September 27, 2016 05:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geniushkg/bfd67417e4596d52a25ab862d594bdec to your computer and use it in GitHub Desktop.
Save geniushkg/bfd67417e4596d52a25ab862d594bdec to your computer and use it in GitHub Desktop.
sample gist to filter content from retrofit response
// 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