List of usage examples for android.database Cursor getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.wit.android.support.database.adapter.BaseCursorAdapter.java
/** * Inner implementation of {@link #onWrapCursor(android.database.Cursor)} to hide such an implementation. *///from ww w. java 2 s .c om @SuppressWarnings("unchecked") private C wrapCursorInner(Cursor cursor) { if (mClassOfCursorWrapper != null) { if (mClassOfCursorWrapper.equals(cursor.getClass())) { // Do not wrap same classes. return (C) cursor; } try { return mClassOfCursorWrapper.getConstructor(Cursor.class).newInstance(cursor); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new IllegalStateException("Failed to create cursor wrapper from class(" + mClassOfCursorWrapper + "). " + "Check if this wrapper class has public access and public constructor which takes Cursor as parameter."); } } return (C) cursor; }