當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。