本文整理汇总了Java中com.google.android.apps.iosched.provider.ScheduleContract.Sessions.buildWithTracksUri方法的典型用法代码示例。如果您正苦于以下问题:Java Sessions.buildWithTracksUri方法的具体用法?Java Sessions.buildWithTracksUri怎么用?Java Sessions.buildWithTracksUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.apps.iosched.provider.ScheduleContract.Sessions
的用法示例。
在下文中一共展示了Sessions.buildWithTracksUri方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateLoader
import com.google.android.apps.iosched.provider.ScheduleContract.Sessions; //导入方法依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case SessionSummaryQuery._TOKEN:
return new CursorLoader(this, Sessions.buildWithTracksUri(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_SELECTION;
selectionArgs = Sessions.buildUpcomingSelectionArgs(currentTime);
}
return new CursorLoader(this, Sessions.buildWithTracksUri(),
SessionsQuery.PROJECTION, selection, selectionArgs, null);
}
return null;
}
示例2: onCreateLoader
import com.google.android.apps.iosched.provider.ScheduleContract.Sessions; //导入方法依赖的package包/类
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case SessionSummaryQuery._TOKEN:
return new CursorLoader(
this, Sessions.buildWithTracksUri(mSessionId),
SessionSummaryQuery.PROJECTION, null, null, null);
case SessionsQuery._TOKEN:
final long currentTime = UIUtils.getCurrentTime(this);
String selection = Sessions.LIVESTREAM_SELECTION + " and "
+ Sessions.AT_TIME_SELECTION;
String[] selectionArgs = Sessions.buildAtTimeSelectionArgs(currentTime);
return new CursorLoader(this, Sessions.buildWithTracksUri(),
SessionsQuery.PROJECTION, selection,
selectionArgs, null);
case UPCOMING_SESSIONS_QUERY_ID:
final long newCurrentTime = UIUtils.getCurrentTime(this);
String sessionsSelection = Sessions.LIVESTREAM_SELECTION + " and "
+ Sessions.UPCOMING_SELECTION;
String[] sessionsSelectionArgs =
Sessions.buildUpcomingSelectionArgs(newCurrentTime);
return new CursorLoader(this, Sessions.buildWithTracksUri(),
SessionsQuery.PROJECTION, sessionsSelection,
sessionsSelectionArgs, null);
}
return null;
}