use of org.moire.ultrasonic.view.GenreAdapter in project ultrasonic by ultrasonic.
the class SelectGenreActivity method load.
private void load() {
BackgroundTask<List<Genre>> task = new TabActivityBackgroundTask<List<Genre>>(this, true) {
@Override
protected List<Genre> doInBackground() throws Throwable {
MusicService musicService = MusicServiceFactory.getMusicService(SelectGenreActivity.this);
List<Genre> genres = new ArrayList<Genre>();
try {
genres = musicService.getGenres(SelectGenreActivity.this, this);
} catch (Exception x) {
Log.e(TAG, "Failed to load genres", x);
}
return genres;
}
@Override
protected void done(List<Genre> result) {
emptyView.setVisibility(result == null || result.isEmpty() ? View.VISIBLE : View.GONE);
if (result != null) {
genreListView.setAdapter(new GenreAdapter(SelectGenreActivity.this, result));
}
}
};
task.execute();
}
Aggregations