use of org.moire.ultrasonic.domain.Lyrics in project ultrasonic by ultrasonic.
the class LyricsActivity method load.
private void load() {
BackgroundTask<Lyrics> task = new TabActivityBackgroundTask<Lyrics>(this, true) {
@Override
protected Lyrics doInBackground() throws Throwable {
String artist = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ARTIST);
String title = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_TITLE);
MusicService musicService = MusicServiceFactory.getMusicService(LyricsActivity.this);
return musicService.getLyrics(artist, title, LyricsActivity.this, this);
}
@Override
protected void done(Lyrics result) {
TextView artistView = (TextView) findViewById(R.id.lyrics_artist);
TextView titleView = (TextView) findViewById(R.id.lyrics_title);
TextView textView = (TextView) findViewById(R.id.lyrics_text);
if (result != null && result.getArtist() != null) {
artistView.setText(result.getArtist());
titleView.setText(result.getTitle());
textView.setText(result.getText());
} else {
artistView.setText(R.string.lyrics_nomatch);
}
}
};
task.execute();
}
Aggregations