MCPcopy Create free account
hub / github.com/M66B/FairEmail / getColumnIndex

Method getColumnIndex

app/src/main/java/androidx/room/CursorUtil.java:91–101  ·  view source on GitHub ↗

Patches Cursor#getColumnIndex(String) to work around issues on older devices. If the column is not found, it retries with the specified name surrounded by backticks. @param c The cursor. @param name The name of the target column. @return The index of the column, or -1 if not found.

(@NonNull Cursor c, @NonNull String name)

Source from the content-addressed store, hash-verified

89 * @return The index of the column, or -1 if not found.
90 */
91 public static int getColumnIndex(@NonNull Cursor c, @NonNull String name) {
92 int index = c.getColumnIndex(name);
93 if (index >= 0) {
94 return index;
95 }
96 index = c.getColumnIndex("`" + name + "`");
97 if (index >= 0) {
98 return index;
99 }
100 return findColumnIndexBySuffix(c, name);
101 }
102
103 /**
104 * Patches {@link Cursor#getColumnIndexOrThrow(String)} to work around issues on older devices.

Callers 15

getColumnIndexOrThrowMethod · 0.95
onExecuteMethod · 0.45
getShortcutMethod · 0.45
convertToStringMethod · 0.45
onCreateDialogMethod · 0.45
setViewValueMethod · 0.45
convertToStringMethod · 0.45
onItemClickMethod · 0.45
onExecuteMethod · 0.45
_getMethod · 0.45
onSuggestionClickMethod · 0.45
onAddContactMethod · 0.45

Calls 1

Tested by

no test coverage detected