Пример #1
0
  /** {@inheritDoc} */
  @Override
  public Cursor runQueryOnBackgroundThread(final CharSequence constraint) {
    if (getFilterQueryProvider() != null) {
      return getFilterQueryProvider().runQuery(constraint);
    }

    final String sort;
    final String selection;
    final String[] selectionArg;

    sort = Columns.MAKE_NAME.getName() + " COLLATE NOCASE ASC";
    selection = constraint == null ? null : Columns.MAKE_NAME.getName() + " LIKE ?";
    selectionArg = constraint == null ? null : new String[] {"%" + constraint.toString() + "%"};

    return resolver.query(Make.CONTENT_URI, Make.PROJECTION, selection, selectionArg, sort);
  }
Пример #2
0
 /** {@inheritDoc} */
 @Override
 public CharSequence convertToString(final Cursor cursor) {
   return cursor.getString(Columns.MAKE_NAME.getIndex());
 }