use of com.orgzly.android.provider.AgendaCursor in project orgzly-android by orgzly.
the class ListWidgetViewsFactory method onDataSetChanged.
@Override
public void onDataSetChanged() {
if (mCursor != null) {
mCursor.close();
}
// Parse query
QueryParser queryParser = new InternalQueryParser();
Query query = queryParser.parse(queryString);
isPartitioned = query.getOptions().getAgendaDays() > 0;
// from http://stackoverflow.com/a/20645908
final long token = Binder.clearCallingIdentity();
try {
if (isPartitioned) {
Cursor cursor = NotesClient.getCursorForQuery(mContext, queryString);
AgendaCursor.AgendaMergedCursor agendaCursor = AgendaCursor.INSTANCE.create(mContext, cursor, queryString);
mCursor = agendaCursor.getCursor();
originalNoteIDs = agendaCursor.getOriginalNoteIDs();
} else {
mCursor = NotesClient.getCursorForQuery(mContext, queryString);
}
} finally {
Binder.restoreCallingIdentity(token);
}
}
Aggregations