List of usage examples for android.database.sqlite SQLiteCursor getColumnIndex
@Override public int getColumnIndex(String columnName)
From source file:android.support.v7.testutils.TestUtilsMatchers.java
/** * Returns a matcher that matches data entry in <code>SQLiteCursor</code> that has * the specified text in the specified column. *///from ww w . j a v a 2 s . co m public static Matcher<Object> withCursorItemContent(final String columnName, final String expectedText) { return new BoundedMatcher<Object, SQLiteCursor>(SQLiteCursor.class) { @Override public void describeTo(Description description) { description.appendText("doesn't match " + expectedText); } @Override protected boolean matchesSafely(SQLiteCursor cursor) { return TextUtils.equals(expectedText, cursor.getString(cursor.getColumnIndex(columnName))); } }; }