Exemplo n.º 1
0
  @Override
  public List<Movie> loadInBackground() {
    ServiceManager manager = ServiceUtils.getTmdbServiceManager(getContext());

    try {
      ResultsPage page;
      if (TextUtils.isEmpty(mQuery)) {
        page = manager.moviesService().nowPlaying().fire();
      } else {
        page = manager.searchService().movieSearch(mQuery).fire();
      }
      if (page != null && page.results != null) {
        return page.results;
      }
    } catch (TmdbException e) {
      Utils.trackException(getContext(), TAG, e);
      Log.w(TAG, e);
    } catch (ApiException e) {
      Utils.trackException(getContext(), TAG, e);
      Log.w(TAG, e);
    }

    return null;
  }
Exemplo n.º 2
0
 /** Tracks an exception using the Google Analytics {@link EasyTracker} and the local log. */
 public static void trackExceptionAndLog(Context context, String tag, Exception e) {
   trackException(context, tag, e);
   Log.w(tag, e);
 }