當前位置: 首頁>>代碼示例>>Java>>正文


Java LoaderManager.restartLoader方法代碼示例

本文整理匯總了Java中android.app.LoaderManager.restartLoader方法的典型用法代碼示例。如果您正苦於以下問題:Java LoaderManager.restartLoader方法的具體用法?Java LoaderManager.restartLoader怎麽用?Java LoaderManager.restartLoader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.LoaderManager的用法示例。


在下文中一共展示了LoaderManager.restartLoader方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import android.app.LoaderManager; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final String chosenAccountName = AccountUtils.getActiveAccountName(getActivity());
    mPlusClient = new PlusClient.Builder(getActivity(), this, this)
            .clearScopes()
            .setAccountName(chosenAccountName)
            .build();

    final Intent intent = BaseActivity.fragmentArgumentsToIntent(getArguments());
    mSessionUri = intent.getData();

    if (mSessionUri == null) {
        return;
    }

    mSessionId = ScheduleContract.Sessions.getSessionId(mSessionUri);

    mVariableHeightHeader = intent.getBooleanExtra(EXTRA_VARIABLE_HEIGHT_HEADER, false);

    LoaderManager manager = getLoaderManager();
    manager.restartLoader(0, null, this);

    setHasOptionsMenu(true);
}
 
開發者ID:The-WebOps-Club,項目名稱:saarang-iosched,代碼行數:26,代碼來源:SessionFeedbackFragment.java

示例2: onActivityCreated

import android.app.LoaderManager; //導入方法依賴的package包/類
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Activity activity = getActivity();
    if (!activity.isFinishing()) {
        // Start loading data
        LoaderManager loaderManager = getLoaderManager();
        loaderManager.restartLoader(PeopleIveMetQuery.TOKEN, null, this);
        loaderManager.restartLoader(PeopleIveMetSubQuery.TOKEN, null, this);
        // Set up the API client
        GoogleApiClient.Builder builder = new GoogleApiClient.Builder(activity, this, this)
                .addApi(Plus.API)
                .addScope(Plus.SCOPE_PLUS_LOGIN);
        if (AccountUtils.hasActiveAccount(activity)) {
            builder.setAccountName(AccountUtils.getActiveAccountName(activity));
        }
        mApiClient = builder.build();
    }
}
 
開發者ID:ramonrabello,項目名稱:devfestnorte-app,代碼行數:20,代碼來源:PeopleIveMetFragment.java

示例3: onFeedbackQueryComplete

import android.app.LoaderManager; //導入方法依賴的package包/類
private void onFeedbackQueryComplete(Cursor cursor) {
    // Views have not been set up yet -- continue loading the rest of data
    if (mSubmitFeedbackView == null) {
        LoaderManager manager = getLoaderManager();
        manager.restartLoader(SessionsQuery._TOKEN, null, this);
        manager.restartLoader(SpeakersQuery._TOKEN, null, this);
        manager.restartLoader(TAG_METADATA_TOKEN, null, this);
    }

    // Is there existing feedback for this session?
    mAlreadyGaveFeedback = cursor.getCount() > 0;

    if (mAlreadyGaveFeedback) {
        final MessageCardView giveFeedbackCardView = (MessageCardView) mRootView.findViewById(
                R.id.give_feedback_card);
        if (giveFeedbackCardView != null) {
            giveFeedbackCardView.setVisibility(View.GONE);
        }
        if (mSubmitFeedbackView != null) {
            mSubmitFeedbackView.setVisibility(View.GONE);
        }
    }
    LOGD(TAG, "User " + (mAlreadyGaveFeedback ? "already gave" : "has not given") + " feedback for session.");
    cursor.close();
}
 
開發者ID:ramonrabello,項目名稱:devfestnorte-app,代碼行數:26,代碼來源:SessionDetailFragment.java

示例4: restartLoader

import android.app.LoaderManager; //導入方法依賴的package包/類
private void restartLoader() {
    if (cursorValid == null) {
        return;
    }

    // Refresh the message list
    LoaderManager loaderManager = getLoaderManager();
    for (int i = 0; i < accountUuids.length; i++) {
        loaderManager.restartLoader(i, null, this);
        cursorValid[i] = false;
    }
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:13,代碼來源:MessageListFragment.java

示例5: reSort

import android.app.LoaderManager; //導入方法依賴的package包/類
private void reSort() {
    int toastString = sortType.getToast(sortAscending);

    Toast toast = Toast.makeText(getActivity(), toastString, Toast.LENGTH_SHORT);
    toast.show();

    LoaderManager loaderManager = getLoaderManager();
    for (int i = 0, len = accountUuids.length; i < len; i++) {
        loaderManager.restartLoader(i, null, this);
    }
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:12,代碼來源:MessageListFragment.java

示例6: loadSessions

import android.app.LoaderManager; //導入方法依賴的package包/類
/**
 * Prepares and starts a SessionLoader for the specified query token.
 */
private void loadSessions(String roomId, String roomTitle, int roomType, int queryToken){
    setHeader(MapUtils.getRoomIcon(roomType), roomTitle, null);
    onSessionListLoading(roomId, roomTitle);

    // Load the following sessions for this room
    LoaderManager lm = getLoaderManager();
    Bundle args = new Bundle();
    args.putString(QUERY_ARG_ROOMID, roomId);
    args.putString(QUERY_ARG_ROOMTITLE, roomTitle);
    args.putInt(QUERY_ARG_ROOMTYPE, roomType);
    lm.restartLoader(queryToken, args, this);
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:16,代碼來源:MapInfoFragment.java

示例7: onUserAction

import android.app.LoaderManager; //導入方法依賴的package包/類
/**
 * Called when the user has performed an {@code action}, with data to be passed
 * as a {@link android.os.Bundle} in {@code args}.
 * <p/>
 * Add the constants used to store values in the bundle to the Model implementation class
 * as final static protected strings.
 * <p/>
 * If the {@code action} should trigger a new data query, specify the query ID by storing the
 * associated Integer in the {@code args} using {@link #KEY_RUN_QUERY_ID}. The {@code args} will
 * be passed on to the cursor loader so you can pass in extra arguments for your query.
 */
@Override
public void onUserAction(UserActionEnum action, @Nullable Bundle args) {
    boolean isValid = false;
    if (mValidUserActions != null && mValidUserActions.length > 0 && action != null) {
        for (int i = 0; i < mValidUserActions.length; i++) {
            if (mValidUserActions[i].getId() == action.getId()) {
                isValid = true;
            }
        }
    }
    if (isValid) {
        if (args != null && args.containsKey(KEY_RUN_QUERY_ID)) {
            Object queryId = args.get(KEY_RUN_QUERY_ID);
            if (queryId instanceof Integer) {
                LoaderManager manager = getLoaderManager();
                manager.restartLoader((Integer) queryId, args, this);
            } else {
                // Query id should be an integer!
                LOGE(TAG, "onUserAction called with a bundle containing KEY_RUN_QUERY_ID but"
                        + "the value is not an Integer so it's not a valid query id!");
            }
        }
        boolean success = mModel.requestModelUpdate(action, args);
        if (!success) {
            // User action not understood by model, even though the presenter understands it.
            LOGE(TAG, "Model doesn't implement user action " + action.getId() + ". Have you "
                    + "forgotten to implement this UserActionEnum in your model, or have you "
                    + "called setValidUserActions on your presenter with a UserActionEnum that "
                    + "it shouldn't support?");
        }
    } else {
        // User action not understood.
        LOGE(TAG, "Invalid user action " + action.getId() + ". Have you called "
                + "setValidUserActions on your presenter, with all the UserActionEnum you want "
                + "to support?");
    }
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:49,代碼來源:PresenterFragmentImpl.java

示例8: restart

import android.app.LoaderManager; //導入方法依賴的package包/類
public void restart(@NonNull Observer<T> observer) {
    final LoaderManager lm = mLmRef.get();
    if (lm != null) {
        synchronized (LoaderManager.class) {
            lm.restartLoader(mLoaderId, Bundle.EMPTY, new RxLcImpl<>(mContext, mObservable, observer));
        }
    }
}
 
開發者ID:ArturVasilov,項目名稱:AndroidArchitecture,代碼行數:9,代碼來源:RxLoader.java

示例9: restartLoader

import android.app.LoaderManager; //導入方法依賴的package包/類
private void restartLoader() {
    if (mCursorValid == null) {
        return;
    }

    // Refresh the message list
    LoaderManager loaderManager = getLoaderManager();
    for (int i = 0; i < mAccountUuids.length; i++) {
        loaderManager.restartLoader(i, null, this);
        mCursorValid[i] = false;
    }
}
 
開發者ID:scoute-dich,項目名稱:K9-MailClient,代碼行數:13,代碼來源:MessageListFragment.java

示例10: reSort

import android.app.LoaderManager; //導入方法依賴的package包/類
private void reSort() {
    int toastString = mSortType.getToast(mSortAscending);

    Toast toast = Toast.makeText(getActivity(), toastString, Toast.LENGTH_SHORT);
    toast.show();

    LoaderManager loaderManager = getLoaderManager();
    for (int i = 0, len = mAccountUuids.length; i < len; i++) {
        loaderManager.restartLoader(i, null, this);
    }
}
 
開發者ID:scoute-dich,項目名稱:K9-MailClient,代碼行數:12,代碼來源:MessageListFragment.java

示例11: onNavigationItemSelected

import android.app.LoaderManager; //導入方法依賴的package包/類
@Override
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
	LoaderManager lm = getLoaderManager();
	Bundle b = new Bundle();
	b.putInt("storedType", itemPosition);
	lm.restartLoader(2, b, ShowsStoredFragment.this);
	stored_type = (itemPosition == ShowsStoredAsyncTaskLoader.STORED_RECENT_SHOWS ?
			ScrollingShowAdapter.MENU_RECENT : ScrollingShowAdapter.MENU_BOOKMARK);
			
	return true;
}
 
開發者ID:sedenardi,項目名稱:vibevault,代碼行數:12,代碼來源:ShowsStoredFragment.java

示例12: executeRefresh

import android.app.LoaderManager; //導入方法依賴的package包/類
private void executeRefresh(){
	if(voteType==-1){
		return;
	}
	LoaderManager lm = getLoaderManager();
	Bundle b = new Bundle();
	b.putIntArray("queryArray", new int[] {voteType, voteResultType, numResults, offset, artistId});
	lm.restartLoader(2, b, VotesFragment.this);
}
 
開發者ID:sedenardi,項目名稱:vibevault,代碼行數:10,代碼來源:VotesFragment.java

示例13: executeSearch

import android.app.LoaderManager; //導入方法依賴的package包/類
private void executeSearch(String query) {
	dateChanged = false;
	Bundle b = new Bundle();
	b.putString("query", query);
	LoaderManager lm = this.getLoaderManager();
	if(lm.getLoader(0)!=null){
		// We already have a loader.
		Logging.Log(LOG_TAG, "RESTART.");
		lm.restartLoader(0, b, this);
	} else{
		// We need a new loader.
		lm.initLoader(0, b, this);
	}
}
 
開發者ID:sedenardi,項目名稱:vibevault,代碼行數:15,代碼來源:SearchFragment.java

示例14: retrieveAccessToken

import android.app.LoaderManager; //導入方法依賴的package包/類
public void retrieveAccessToken(String code)
{
    LoaderManager lm = getLoaderManager();
    Bundle b = new Bundle();
    b.putString(OAuthAccessTokenLoader.PARAM_CODE, "code");
    b.putString(OAuthAccessTokenLoader.PARAM_APIKEY, apiKey);
    b.putString(OAuthAccessTokenLoader.PARAM_APISECRET, apiSecret);
    b.putString(OAuthAccessTokenLoader.PARAM_CALLBACK_URL, callback);
    b.putString(OAuthAccessTokenLoader.PARAM_BASEURL, baseOAuthUrl);
    b.putInt(OAuthAccessTokenLoader.PARAM_OPERATION, OAuthAccessTokenLoader.OPERATION_ACCESS_TOKEN);
    b.putString(OAuthAccessTokenLoader.PARAM_CODE, code);
    lm.restartLoader(OAuthAccessTokenLoader.ID, b, this);
}
 
開發者ID:jeanmariepascal,項目名稱:AlfrescoStorageAccessFramework,代碼行數:14,代碼來源:AccountOAuthFragment.java

示例15: initOrRestartLoader

import android.app.LoaderManager; //導入方法依賴的package包/類
public static void initOrRestartLoader(LoaderManager loaderManager, int id, Bundle bundle, LoaderManager.LoaderCallbacks callbacks) {
    Loader loader = loaderManager.getLoader(id);
    if (loader == null) {
        loaderManager.initLoader(id, bundle, callbacks);
    } else {
        loaderManager.restartLoader(id, bundle, callbacks);
    }

}
 
開發者ID:AAverin,項目名稱:android-skeleton-project,代碼行數:10,代碼來源:Utils.java


注:本文中的android.app.LoaderManager.restartLoader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。