コード例 #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;
  }
コード例 #2
0
ファイル: Utils.java プロジェクト: hopefulcd/SeriesGuide
 /** 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);
 }