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


Java Loader.getId方法代码示例

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


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

示例1: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onLoadFinished(final Loader loader, final Object data) {
    final int id = loader.getId();

    switch (id) {
        case SavedEntriesQueryLoader.ID:
            onDbQueryResult();
            break;
        case SavedEntriesDeleteLoader.ID:
            onSavedEntriesDeleted((List<Integer>) data);
            break;
    }

    getLoaderManager().destroyLoader(id);
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:17,代码来源:SavedEntriesFragment.java

示例2: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<List<Recipient>> loader, List<Recipient> data) {
    if (loaderManager == null) {
        return;
    }

    switch (loader.getId()) {
        case LOADER_ID_FILTERING: {
            adapter.setRecipients(data);
            break;
        }
        case LOADER_ID_ALTERNATES: {
            postShowAlternatesPopup(data);
            loaderManager.destroyLoader(LOADER_ID_ALTERNATES);
            break;
        }
    }
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:19,代码来源:RecipientSelectView.java

示例3: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (cursor == null) {
        // NULL cursor. This usually means there's no image database yet....
        return;
    }

    switch (loader.getId()) {
        case CURSORLOADER_THUMBS:
            imagecursor = cursor;
            image_column_index = imagecursor.getColumnIndex(MediaStore.Images.Media._ID);
            image_column_orientation = imagecursor.getColumnIndex(MediaStore.Images.Media.ORIENTATION);
            ia.notifyDataSetChanged();
            break;
        case CURSORLOADER_REAL:
            actualimagecursor = cursor;
            String[] columns = actualimagecursor.getColumnNames();
            actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
            orientation_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.ORIENTATION);
            break;
        default:
            break;
    }
}
 
开发者ID:disit,项目名称:siiMobilityAppKit,代码行数:25,代码来源:MultiImageChooserActivity.java

示例4: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (cursor != null && cursor.moveToNext()) {
        switch (loader.getId()) {
            case RELATED_VIDEO_LOADER: {
                mVideoCursorAdapter.changeCursor(cursor);
                break;
            }
            default: {
                // Loading video from global search.
                mSelectedVideo = (Video) mVideoCursorMapper.convert(cursor);

                setupAdapter();
                setupDetailsOverviewRow();
                setupMovieListRow();
                updateBackground(mSelectedVideo.bgImageUrl);

                // When a Related Video item is clicked.
                setOnItemViewClickedListener(new ItemViewClickedListener());
            }
        }
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:24,代码来源:VideoDetailsFragment.java

示例5: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
    Log.d(TAG,"onLoadFinished() cursor id="+cursorLoader.getId());
    if (cursorLoader.getId() == LOADER_ID_LAST_ADDED) {
        updateLastAddedRow(cursor);
        mInitLastAddedCount = cursor.getCount();
    }
    else if (cursorLoader.getId() == LOADER_ID_LAST_PLAYED) {
        updateLastPlayedRow(cursor);
        mInitLastPlayedCount = cursor.getCount();
    }
    else if (cursorLoader.getId() == LOADER_ID_ALL_TV_SHOWS) {
        updateTvShowsRow(cursor);
    }
    else if (cursorLoader.getId() == LOADER_ID_NON_SCRAPED_VIDEOS_COUNT) {
        updateNonScrapedVideosVisibility(cursor);
    }

    checkFocusInitialization();
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:21,代码来源:MainFragment.java

示例6: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor c) {
    // List of categories
    if (cursorLoader.getId() == -1) {

        // Empty view visibility
        mEmptyView.setVisibility(c.getCount() > 0 ? View.GONE : View.VISIBLE);

        if (mCurrentCategoriesCursor != null) {
            if (!isCategoriesListModified(mCurrentCategoriesCursor, c)) {
                // no actual modification, no need to rebuild all the rows
                mCurrentCategoriesCursor = c; // keep the reference to the new cursor because the old one won't be valid anymore
                return;
            }
        }
        mCurrentCategoriesCursor = c;
        loadCategoriesRows(c);
    }
    // One of the row
    else {
        CursorObjectAdapter adapter = mAdaptersMap.get(cursorLoader.getId());
        if (adapter != null) {
            adapter.changeCursor(c);
        }
    }
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:27,代码来源:MoviesByFragment.java

示例7: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void onLoadFinished(final Loader loader, final Object data) {
    final int id = loader.getId();

    switch (id) {
        case IsFeedUpdateAvailableLoader.ID:
            onFeedUpdateResult((String) data);
            break;
        case OPMLImportLoader.ID:
            onOPMLImportResult((List<Outline>) data);
            break;
        case SavedEntriesSaveLoader.ID:
            Toast.info(this, getString(R.string.toast_entry_save_succeeded));
            break;
        default:
            break;
    }

    getLoaderManager().destroyLoader(id);
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:22,代码来源:MainActivity.java

示例8: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
    // Swap the new cursor in.  (The framework will take care of closing the
    // old cursor once we return.)
    int i = loader.getId();
    if(i == LOADER_ID_HISTORY) {
        historyAdapter.swapCursor(data);
    }else{
        detailAdapters[i].swapCursor(data);
    }

}
 
开发者ID:ramack,项目名称:ActivityDiary,代码行数:12,代码来源:HistoryActivity.java

示例9: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    switch (loader.getId()) {
        case ExploreSessionsQuery.NORMAL_TOKEN: // fall through
        case ExploreSessionsQuery.SEARCH_TOKEN:
            reloadSessionData(cursor);
            break;
        case TAG_METADATA_TOKEN:
            mTagMetadata = new TagMetadata(cursor);
            break;
        default:
            cursor.close();
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:15,代码来源:ExploreSessionsFragment.java

示例10: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<LocalMessage> loader, LocalMessage message) {
    if (loader.getId() != LOCAL_MESSAGE_LOADER_ID) {
        throw new IllegalStateException("loader id must be message loader id");
    }

    localMessage = message;
    if (message == null) {
        onLoadMessageFromDatabaseFailed();
    } else {
        onLoadMessageFromDatabaseFinished();
    }
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:14,代码来源:MessageLoaderHelper.java

示例11: onLoaderReset

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoaderReset(Loader<MessageViewInfo> loader) {
    if (loader.getId() != DECODE_MESSAGE_LOADER_ID) {
        throw new IllegalStateException("loader id must be message decoder id");
    }
    // Do nothing
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:8,代码来源:MessageLoaderHelper.java

示例12: onLoaderReset

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoaderReset(Loader<Cursor> loader) {
    if (loader.getId() == CURSORLOADER_THUMBS) {
        imagecursor = null;
    } else if (loader.getId() == CURSORLOADER_REAL) {
        actualimagecursor = null;
    }
}
 
开发者ID:disit,项目名称:siiMobilityAppKit,代码行数:9,代码来源:MultiImageChooserActivity.java

示例13: onLoaderReset

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoaderReset(Loader<Cursor> loader) {
    int loaderId = loader.getId();
    if (loaderId != CATEGORY_LOADER) {
        mVideoCursorAdapters.get(loaderId).changeCursor(null);
    } else {
        mCategoryRowAdapter.clear();
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:10,代码来源:MainFragment.java

示例14: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    if (cursor != null && cursor.moveToFirst()) {
        switch (loader.getId()) {
            case QUEUE_VIDEOS_LOADER: {
                mQueue.clear();
                while (!cursor.isAfterLast()) {
                    Video v = (Video) mVideoCursorMapper.convert(cursor);

                    // Set the queue index to the selected video.
                    if (v.id == mSelectedVideo.id) {
                        mQueueIndex = mQueue.size();
                    }

                    // Add the video to the queue.
                    MediaSessionCompat.QueueItem item = getQueueItem(v);
                    mQueue.add(item);

                    cursor.moveToNext();
                }

                mSession.setQueue(mQueue);
                mSession.setQueueTitle(getString(R.string.queue_name));
                break;
            }
            case RECOMMENDED_VIDEOS_LOADER: {
                mVideoCursorAdapter.changeCursor(cursor);
                break;
            }
            default: {
                // Playing a specific video.
                Video video = (Video) mVideoCursorMapper.convert(cursor);
                playVideo(video, mAutoPlayExtras);
                break;
            }
        }
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:39,代码来源:PlaybackOverlayFragment.java

示例15: onLoadFinished

import android.content.Loader; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
    switch (loader.getId()) {
        case TAG_METADATA_TOKEN:
            mTagMetadata = new TagMetadata(cursor);
            onTagMetadataLoaded();
            break;
        default:
            cursor.close();
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:12,代码来源:ExploreSessionsActivity.java


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