@Override
        public void onResponse(BaseItemDto album) {

          Intent intent = new Intent(SearchResultsActivity.this, MusicAlbumActivity.class);
          intent.putExtra("AlbumId", album.getId());
          startActivity(intent);
          SearchResultsActivity.this.finish();
        }
        @Override
        public void onResponse(BaseItemDto item) {

          if (item == null) return;

          Intent intent;
          if (item.getType().equalsIgnoreCase("musicartist")) {
            intent = new Intent(SearchResultsActivity.this, ArtistActivity.class);
            intent.putExtra("ArtistId", item.getId());
          } else if (item.getType().equalsIgnoreCase("musicalbum")) {
            intent = new Intent(SearchResultsActivity.this, MusicAlbumActivity.class);
            intent.putExtra("AlbumId", item.getId());
          } else { // It's a song
            MainApplication.getInstance()
                .API
                .GetItemAsync(
                    item.getParentId(),
                    MainApplication.getInstance().API.getCurrentUserId(),
                    getAlbumResponse);
            return;
          }
          startActivity(intent);
          SearchResultsActivity.this.finish();
        }
Exemplo n.º 3
0
  public String getItemId() {
    switch (type) {
      case BaseItem:
      case LiveTvProgram:
      case LiveTvRecording:
        return baseItem.getId();
      case Person:
        return person.getId();
      case Chapter:
        return chapterInfo.getItemId();
      case Server:
        return serverInfo.getId();
      case User:
        return user.getId();
      case LiveTvChannel:
        return channelInfo.getId();
      case GridButton:
        return null;
      case SearchHint:
        return searchHint.getItemId();
    }

    return null;
  }