use of org.moire.ultrasonic.domain.SearchCriteria in project ultrasonic by ultrasonic.
the class SearchActivity method search.
private void search(final String query, final boolean autoplay) {
final int maxArtists = Util.getMaxArtists(this);
final int maxAlbums = Util.getMaxAlbums(this);
final int maxSongs = Util.getMaxSongs(this);
BackgroundTask<SearchResult> task = new TabActivityBackgroundTask<SearchResult>(this, true) {
@Override
protected SearchResult doInBackground() throws Throwable {
SearchCriteria criteria = new SearchCriteria(query, maxArtists, maxAlbums, maxSongs);
MusicService service = MusicServiceFactory.getMusicService(SearchActivity.this);
licenseValid = service.isLicenseValid(SearchActivity.this, this);
return service.search(criteria, SearchActivity.this, this);
}
@Override
protected void done(SearchResult result) {
searchResult = result;
populateList();
if (autoplay) {
autoplay();
}
}
};
task.execute();
}
Aggregations