Guest User

Untitled

a guest
Jul 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. /**
  2. * getAllFavourites method to get the favourites movies with the help of Executors
  3. * and then calling the switch adapter method to change the data in the activity
  4. */
  5. public void getAllFavourites() {
  6. //Get list of movies
  7.  
  8. // Earlier used this => final List<MovieResponseEntity.Result> entityList = new ArrayList<MovieResponseEntity.Result>();
  9.  
  10. final ArrayList<List<MovieResponseEntity.Result>> entityList = new ArrayList<List<MovieResponseEntity.Result>>();
  11. AppExecutor.getInstance().diskIO().execute(new Runnable() {
  12. @Override
  13. public void run() {
  14. entityList.add(FavouriteMoviesDatabase.getDatabase(getApplicationContext()).moviesDao().getFavouriteMovieList());
  15. }
  16. });
Add Comment
Please, Sign In to add comment