Ejemplo n.º 1
0
  @Background
  protected void listArtists(String query) {
    this.isLoading = true;
    PaginatedList<Artist> searchResult = PaginatedList.empty();

    this.query = query;

    try {
      searchResult = artistService.search(query);
    } catch (NoInternetConnectionException e) {
      showNoInternetMessage();
      e.printStackTrace();
    } catch (LazyInternetConnectionException e) {
      showLazyInternetMessage();
      e.printStackTrace();
    } catch (Exception e) {
      this.alert(e.getMessage());
      e.printStackTrace();
    }
    updateListView(searchResult);
  }
Ejemplo n.º 2
0
  @Background
  protected void loadMore() {
    this.isLoading = true;
    PaginatedList<Artist> searchResult = PaginatedList.empty();

    try {
      if (!artistsFound.getPaging().isLast()) {
        searchResult =
            artistService.search(query, 50, artistsFound.getPaging().getActualPage() + 1);
        artistsFound.getPaging().setActualPage(artistsFound.getPaging().getActualPage() + 1);
      }
    } catch (NoInternetConnectionException e) {
      showNoInternetMessage();
      e.printStackTrace();
    } catch (LazyInternetConnectionException e) {
      showLazyInternetMessage();
      e.printStackTrace();
    } catch (Exception e) {
      this.alert(e.getMessage());
      e.printStackTrace();
    }
    updateListView(searchResult);
  }