本文整理汇总了Java中com.google.samples.apps.iosched.provider.ScheduleContract.Sessions.CONTENT_URI属性的典型用法代码示例。如果您正苦于以下问题:Java Sessions.CONTENT_URI属性的具体用法?Java Sessions.CONTENT_URI怎么用?Java Sessions.CONTENT_URI使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.samples.apps.iosched.provider.ScheduleContract.Sessions
的用法示例。
在下文中一共展示了Sessions.CONTENT_URI属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateLoader
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case SessionSummaryQuery._TOKEN:
return new CursorLoader(this, Sessions.buildSessionUri(mSessionId),
SessionSummaryQuery.PROJECTION, null, null, null);
case SessionsQuery._TOKEN:
boolean futureSessions = false;
if (args != null) {
futureSessions = args.getBoolean(LOADER_SESSIONS_ARG, false);
}
final long currentTime = UIUtils.getCurrentTime(this);
String selection = Sessions.LIVESTREAM_SELECTION + " and ";
String[] selectionArgs;
if (!futureSessions) {
selection += Sessions.AT_TIME_SELECTION;
selectionArgs = Sessions.buildAtTimeSelectionArgs(currentTime);
} else {
selection += Sessions.UPCOMING_LIVE_SELECTION;
selectionArgs = Sessions.buildUpcomingSelectionArgs(currentTime);
}
return new CursorLoader(this, Sessions.CONTENT_URI, SessionsQuery.PROJECTION,
selection, selectionArgs, SessionsQuery.SORT_ORDER);
}
return null;
}
示例2: addSessions
protected void addSessions(final long start, final long end,
@NonNull final ArrayList<ScheduleItem> items, final TagFilterHolder filters) {
Cursor cursor = null;
try {
Uri uri = Sessions.CONTENT_URI;
String selection = Sessions.STARTING_AT_TIME_INTERVAL_SELECTION;
if (mMode == MODE_STARRED_ITEMS) {
selection = DatabaseUtils.concatenateWhere(selection,
Sessions.IN_SCHEDULE_SELECTION);
}
if (filters != null) {
uri = Sessions.buildCategoryTagFilterUri(uri, filters.getSelectedFilterIds(),
filters.getCategoryCount());
}
cursor = mContext.getContentResolver().query(
uri,
ScheduleItemHelper.REQUIRED_SESSION_COLUMNS,
selection,
new String[]{String.valueOf(start), String.valueOf(end)},
// order by session start
Sessions.SESSION_START);
ScheduleItemHelper.cursorToItems(cursor, mContext, items);
} finally {
if (cursor != null) {
cursor.close();
}
}
}