@Override
    public void bindView(final View view, final Context context, final Cursor cursor) {
      final ExchangeRate exchangeRate = ExchangeRatesProvider.getExchangeRate(cursor);
      final boolean isDefaultCurrency = exchangeRate.currencyCode.equals(defaultCurrency);

      view.setBackgroundResource(isDefaultCurrency ? R.color.bg_list_selected : R.color.bg_list);

      final View defaultView = view.findViewById(R.id.exchange_rate_row_default);
      defaultView.setVisibility(isDefaultCurrency ? View.VISIBLE : View.INVISIBLE);

      final TextView currencyCodeView =
          (TextView) view.findViewById(R.id.exchange_rate_row_currency_code);
      currencyCodeView.setText(exchangeRate.currencyCode);

      final CurrencyTextView rateView =
          (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_rate);
      rateView.setPrecision(Constants.LOCAL_PRECISION, 0);
      rateView.setAmount(WalletUtils.localValue(rateBase, exchangeRate.rate));

      final CurrencyTextView walletView =
          (CurrencyTextView) view.findViewById(R.id.exchange_rate_row_balance);
      walletView.setPrecision(Constants.LOCAL_PRECISION, 0);
      if (!replaying) {
        walletView.setAmount(WalletUtils.localValue(balance, exchangeRate.rate));
        walletView.setStrikeThru(Constants.TEST);
      } else {
        walletView.setText("n/a");
        walletView.setStrikeThru(false);
      }
      walletView.setTextColor(getResources().getColor(R.color.fg_less_significant));
    }
 @Override
 public Loader<Cursor> onCreateLoader(final int id, final Bundle args) {
   return new CursorLoader(
       activity,
       ExchangeRatesProvider.contentUri(activity.getPackageName()),
       null,
       null,
       null,
       null);
 }
  @Override
  public void onListItemClick(final ListView l, final View v, final int position, final long id) {
    final Cursor cursor = (Cursor) adapter.getItem(position);
    final ExchangeRate exchangeRate = ExchangeRatesProvider.getExchangeRate(cursor);

    activity.startActionMode(
        new ActionMode.Callback() {
          @Override
          public boolean onCreateActionMode(final ActionMode mode, final Menu menu) {
            final MenuInflater inflater = mode.getMenuInflater();
            inflater.inflate(R.menu.exchange_rates_context, menu);

            return true;
          }

          @Override
          public boolean onPrepareActionMode(final ActionMode mode, final Menu menu) {
            mode.setTitle(exchangeRate.currencyCode);
            mode.setSubtitle(
                getString(R.string.exchange_rates_fragment_source, exchangeRate.source));

            return true;
          }

          @Override
          public boolean onActionItemClicked(final ActionMode mode, final MenuItem item) {
            switch (item.getItemId()) {
              case R.id.exchange_rates_context_set_as_default:
                handleSetAsDefault(exchangeRate.currencyCode);

                mode.finish();
                return true;
            }

            return false;
          }

          @Override
          public void onDestroyActionMode(final ActionMode mode) {}

          private void handleSetAsDefault(final String currencyCode) {
            config.setExchangeCurrencyCode(currencyCode);
          }
        });
  }