public void markItem(ContentValues values, boolean centerToItem) {
    Long id = values.getAsLong(POIs.POI_ID);
    int pos;
    for (pos = 0; pos < mAdapter.getCount(); pos++) {
      Cursor c = (Cursor) mAdapter.getItem(pos);
      if (POIHelper.getId(c) == id) {
        mCheckedItem = pos + 1;
        mPullToRefreshListView.getRefreshableView().setItemChecked(mCheckedItem, true);

        break;
      }
    }

    mPullToRefreshListView
        .getRefreshableView()
        .setSelection(mPullToRefreshListView.getRefreshableView().getCheckedItemPosition());
  }
  private void setCursor(Cursor cursor) {
    Log.d(
        TAG,
        "setCursor cursor "
            + ((cursor != null) ? cursor.hashCode() : "null")
            + " count = "
            + ((cursor != null) ? cursor.getCount() : "null")
            + " isNewCursor = "
            + (cursor != mCursor));
    if (cursor == mCursor) return;

    mCursor = cursor;
    if (mCursor != null) {
      mDirectionCursorWrapper = new DirectionCursorWrapper(mCursor);
    } else {
      mDirectionCursorWrapper = null;
    }
    mAdapter.swapCursor(mDirectionCursorWrapper);
    markItemClear();
    refreshListPosition();
  }
  private void updateDirection(float direction) {
    if (mDirectionCursorWrapper == null) return;

    mDirectionCursorWrapper.setDeviceDirection(direction);
    mAdapter.notifyDataSetChanged();
  }
 @Subscribe
 public void onDistanceUnitChanged(DistanceUnitChangedEvent e) {
   Log.d(TAG, "onDistanceUnitChanged");
   mAdapter.changeAdapter();
 }
 private void refreshListPosition() {
   if (mFirstVisiblePosition != 0) {
     if (mFirstVisiblePosition >= mAdapter.getCount()) mFirstVisiblePosition = mAdapter.getCount();
     mPullToRefreshListView.getRefreshableView().setSelection(mFirstVisiblePosition);
   }
 }