private Func1 < ArrayList < SoundCloudTrack > , ArrayList < SoundCloudTrack > > cacheTracks ( ) { return new Func1 < ArrayList < SoundCloudTrack > , ArrayList < SoundCloudTrack > > ( ) { @ Override public ArrayList < SoundCloudTrack > call ( ArrayList < SoundCloudTrack > soundCloudTracks ) { if ( soundCloudTracks . size ( ) > 0 ) { mCacheRam . tracks = soundCloudTracks ; } return soundCloudTracks ; } } ; }
Cache the tracks list of the supported artist retrieved from network in RAM to avoid requesting SoundCloud API for next call .