本文整理汇总了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);
}
示例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;
}
}
}
示例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;
}
}
示例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());
}
}
}
}
示例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();
}
示例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);
}
}
}
示例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);
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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
}
示例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;
}
}
示例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();
}
}
示例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;
}
}
}
}
示例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();
}
}