当前位置: 首页>>代码示例>>Java>>正文


Java Sessions.buildSessionUri方法代码示例

本文整理汇总了Java中com.google.android.apps.iosched.provider.ScheduleContract.Sessions.buildSessionUri方法的典型用法代码示例。如果您正苦于以下问题:Java Sessions.buildSessionUri方法的具体用法?Java Sessions.buildSessionUri怎么用?Java Sessions.buildSessionUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.apps.iosched.provider.ScheduleContract.Sessions的用法示例。


在下文中一共展示了Sessions.buildSessionUri方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: insert

import com.google.android.apps.iosched.provider.ScheduleContract.Sessions; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Uri insert(Uri uri, ContentValues values) {
    LOGV(TAG, "insert(uri=" + uri + ", values=" + values.toString() + ")");
    final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    final int match = sUriMatcher.match(uri);
    boolean syncToNetwork = !ScheduleContract.hasCallerIsSyncAdapterParameter(uri);
    switch (match) {
        case BLOCKS: {
            db.insertOrThrow(Tables.BLOCKS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Blocks.buildBlockUri(values.getAsString(Blocks.BLOCK_ID));
        }
        case TRACKS: {
            db.insertOrThrow(Tables.TRACKS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Tracks.buildTrackUri(values.getAsString(Tracks.TRACK_ID));
        }
        case ROOMS: {
            db.insertOrThrow(Tables.ROOMS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Rooms.buildRoomUri(values.getAsString(Rooms.ROOM_ID));
        }
        case SESSIONS: {
            db.insertOrThrow(Tables.SESSIONS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Sessions.buildSessionUri(values.getAsString(Sessions.SESSION_ID));
        }
        case SESSIONS_ID_SPEAKERS: {
            db.insertOrThrow(Tables.SESSIONS_SPEAKERS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Speakers.buildSpeakerUri(values.getAsString(SessionsSpeakers.SPEAKER_ID));
        }
        case SESSIONS_ID_TRACKS: {
            db.insertOrThrow(Tables.SESSIONS_TRACKS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Tracks.buildTrackUri(values.getAsString(SessionsTracks.TRACK_ID));
        }
        case SPEAKERS: {
            db.insertOrThrow(Tables.SPEAKERS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Speakers.buildSpeakerUri(values.getAsString(Speakers.SPEAKER_ID));
        }
        case VENDORS: {
            db.insertOrThrow(Tables.VENDORS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Vendors.buildVendorUri(values.getAsString(Vendors.VENDOR_ID));
        }
        case ANNOUNCEMENTS: {
            db.insertOrThrow(Tables.ANNOUNCEMENTS, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return Announcements.buildAnnouncementUri(values
                    .getAsString(Announcements.ANNOUNCEMENT_ID));
        }
        case SEARCH_SUGGEST: {
            db.insertOrThrow(Tables.SEARCH_SUGGEST, null, values);
            getContext().getContentResolver().notifyChange(uri, null, syncToNetwork);
            return SearchSuggest.CONTENT_URI;
        }
        default: {
            throw new UnsupportedOperationException("Unknown uri: " + uri);
        }
    }
}
 
开发者ID:amardeshbd,项目名称:google-iosched,代码行数:65,代码来源:ScheduleProvider.java

示例2: insert

import com.google.android.apps.iosched.provider.ScheduleContract.Sessions; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public Uri insert(Uri uri, ContentValues values) {
    LOGV(TAG, "insert(uri=" + uri + ", values=" + values.toString() + ")");
    final SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    final int match = sUriMatcher.match(uri);
    boolean syncToNetwork = !ScheduleContract.hasCallerIsSyncAdapterParameter(uri);
    switch (match) {
        case BLOCKS: {
            db.insertOrThrow(Tables.BLOCKS, null, values);
            notifyChange(uri, syncToNetwork);
            return Blocks.buildBlockUri(values.getAsString(Blocks.BLOCK_ID));
        }
        case TRACKS: {
            db.insertOrThrow(Tables.TRACKS, null, values);
            notifyChange(uri, syncToNetwork);
            return Tracks.buildTrackUri(values.getAsString(Tracks.TRACK_ID));
        }
        case ROOMS: {
            db.insertOrThrow(Tables.ROOMS, null, values);
            notifyChange(uri, syncToNetwork);
            return Rooms.buildRoomUri(values.getAsString(Rooms.ROOM_ID));
        }
        case SESSIONS: {
            db.insertOrThrow(Tables.SESSIONS, null, values);
            notifyChange(uri, syncToNetwork);
            return Sessions.buildSessionUri(values.getAsString(Sessions.SESSION_ID));
        }
        case SESSIONS_ID_SPEAKERS: {
            db.insertOrThrow(Tables.SESSIONS_SPEAKERS, null, values);
            notifyChange(uri, syncToNetwork);
            return Speakers.buildSpeakerUri(values.getAsString(SessionsSpeakers.SPEAKER_ID));
        }
        case SESSIONS_ID_TRACKS: {
            db.insertOrThrow(Tables.SESSIONS_TRACKS, null, values);
            notifyChange(uri, syncToNetwork);
            return Tracks.buildTrackUri(values.getAsString(SessionsTracks.TRACK_ID));
        }
        case SPEAKERS: {
            db.insertOrThrow(Tables.SPEAKERS, null, values);
            notifyChange(uri, syncToNetwork);
            return Speakers.buildSpeakerUri(values.getAsString(Speakers.SPEAKER_ID));
        }
        case SANDBOX: {
            db.insertOrThrow(Tables.SANDBOX, null, values);
            notifyChange(uri, syncToNetwork);
            return Sandbox.buildCompanyUri(values.getAsString(Sandbox.COMPANY_ID));
        }
        case ANNOUNCEMENTS: {
            db.insertOrThrow(Tables.ANNOUNCEMENTS, null, values);
            notifyChange(uri, syncToNetwork);
            return Announcements.buildAnnouncementUri(values
                    .getAsString(Announcements.ANNOUNCEMENT_ID));
        }
        case SEARCH_SUGGEST: {
            db.insertOrThrow(Tables.SEARCH_SUGGEST, null, values);
            notifyChange(uri, syncToNetwork);
            return SearchSuggest.CONTENT_URI;
        }
        case MAPMARKERS: {
            db.insertOrThrow(Tables.MAPMARKERS, null, values);
            notifyChange(uri, syncToNetwork);
            return MapMarkers.buildMarkerUri(values.getAsString(MapMarkers.MARKER_ID));
        }
        case MAPTILES: {
            db.insertOrThrow(Tables.MAPTILES, null, values);
            notifyChange(uri, syncToNetwork);
            return MapTiles.buildFloorUri(values.getAsString(MapTiles.TILE_FLOOR));
        }
        case FEEDBACK_FOR_SESSION: {
            db.insertOrThrow(Tables.FEEDBACK, null, values);
            notifyChange(uri, syncToNetwork);
            return Feedback.buildFeedbackUri(values.getAsString(Feedback.SESSION_ID));
        }
        default: {
            throw new UnsupportedOperationException("Unknown uri: " + uri);
        }
    }
}
 
开发者ID:TheDeltaProgram,项目名称:iosched2013,代码行数:80,代码来源:ScheduleProvider.java


注:本文中的com.google.android.apps.iosched.provider.ScheduleContract.Sessions.buildSessionUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。