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


Java AndroidRuntimeException類代碼示例

本文整理匯總了Java中android.util.AndroidRuntimeException的典型用法代碼示例。如果您正苦於以下問題:Java AndroidRuntimeException類的具體用法?Java AndroidRuntimeException怎麽用?Java AndroidRuntimeException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: requestFeature

import android.util.AndroidRuntimeException; //導入依賴的package包/類
@Override
public boolean requestFeature(int featureId) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId);

    if (mContentParent != null) {
        throw new AndroidRuntimeException("requestFeature() must be called before adding content");
    }

    switch (featureId) {
        case Window.FEATURE_ACTION_BAR:
        case Window.FEATURE_ACTION_BAR_OVERLAY:
        case Window.FEATURE_ACTION_MODE_OVERLAY:
        case Window.FEATURE_INDETERMINATE_PROGRESS:
        case Window.FEATURE_NO_TITLE:
        case Window.FEATURE_PROGRESS:
            mFeatures |= (1 << featureId);
            return true;

        default:
            return false;
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:ActionBarSherlockCompat.java

示例2: start

import android.util.AndroidRuntimeException; //導入依賴的package包/類
private void start(boolean playBackwards) {
    if (Looper.myLooper() == null) {
        throw new AndroidRuntimeException("Animators may only be run on Looper threads");
    }
    mPlayingBackwards = playBackwards;
    mCurrentIteration = 0;
    mPlayingState = STOPPED;
    mStarted = true;
    mStartedDelay = false;
    mPaused = false;
    AnimationHandler animationHandler = getOrCreateAnimationHandler();
    animationHandler.mPendingAnimations.add(this);
    if (mStartDelay == 0) {
        setCurrentPlayTime(0);
        mPlayingState = STOPPED;
        mRunning = true;
        notifyStartListeners();
    }
    animationHandler.start();
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:21,代碼來源:ValueAnimator.java

示例3: start

import android.util.AndroidRuntimeException; //導入依賴的package包/類
/** {@inheritDoc} */
@Override
public void start() {
    if (Looper.myLooper() == null) {
        throw new AndroidRuntimeException("Animators may only be run on Looper threads");
    }

    mStarted = true;
    mRunning = false;
    mProgress = 0;

    mLastFrameTime = 0;
    AnimationHandler handler = AnimationHandler.getInstance();
    handler.addAnimationFrameCallback(this, mStartDelay);

    if (mStartDelay == 0) {
        startAnimation();
    }
}
 
開發者ID:unixzii,項目名稱:android-SpringAnimator,代碼行數:20,代碼來源:AbsSpringAnimator.java

示例4: cancel

import android.util.AndroidRuntimeException; //導入依賴的package包/類
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public void cancel() {
    if (Looper.myLooper() == null) {
        throw new AndroidRuntimeException("Animators may only be run on Looper threads");
    }

    if ((mStarted || mRunning) && getListeners() != null) {
        if (!mRunning) {
            // If it's not yet running, then start listeners weren't called. Call them now.
            notifyStartListeners();
        }
        ArrayList<AnimatorListener> tmpListeners =
                (ArrayList<AnimatorListener>) getListeners().clone();
        for (AnimatorListener listener : tmpListeners) {
            listener.onAnimationCancel(this);
        }
    }
    endAnimation();
}
 
開發者ID:unixzii,項目名稱:android-SpringAnimator,代碼行數:22,代碼來源:AbsSpringAnimator.java

示例5: resume

import android.util.AndroidRuntimeException; //導入依賴的package包/類
/** {@inheritDoc} */
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public void resume() {
    if (Looper.myLooper() == null) {
        throw new AndroidRuntimeException("Animators may only be resumed from the same " +
                "thread that the animator was started on");
    }
    if (isPaused()) {
        if (!mRunning) {
            AnimationHandler handler = AnimationHandler.getInstance();
            handler.addAnimationFrameCallback(this, 0);
        }
    }
    super.resume();
}
 
開發者ID:unixzii,項目名稱:android-SpringAnimator,代碼行數:17,代碼來源:AbsSpringAnimator.java

示例6: requestFeature

import android.util.AndroidRuntimeException; //導入依賴的package包/類
@Override
public boolean requestFeature(int featureId) {
    if (BuildConfig.DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId);

    if (mContentParent != null) {
        throw new AndroidRuntimeException("requestFeature() must be called before adding content");
    }

    switch (featureId) {
        case Window.FEATURE_ACTION_BAR:
        case Window.FEATURE_ACTION_BAR_OVERLAY:
        case Window.FEATURE_ACTION_MODE_OVERLAY:
        case Window.FEATURE_INDETERMINATE_PROGRESS:
        case Window.FEATURE_NO_TITLE:
        case Window.FEATURE_PROGRESS:
            mFeatures |= (1 << featureId);
            return true;

        default:
            return false;
    }
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:23,代碼來源:ActionBarSherlockCompat.java

示例7: onAboutLicensesClick

import android.util.AndroidRuntimeException; //導入依賴的package包/類
@OnClick(R.id.about_licenses)
public void onAboutLicensesClick() {
    try {
        new LicensesDialog.Builder(getActivity())
                .setNotices(R.raw.licenses)
                .setTitle(R.string.about_licenses)
                .setIncludeOwnLicense(true)
                .setCloseText(R.string.buttons_ok)
                .build()
                .showAppCompat();
    } catch (AndroidRuntimeException e) {
        View contentView = getActivity().getWindow().getDecorView();
        Snackbar snackbar = Snackbar.make(contentView,
                R.string.message_open_licenses_error, Snackbar.LENGTH_LONG);
        snackbar.setAction(R.string.message_install_web_view, v -> openPlayStore());
        snackbar.show();
    }
}
 
開發者ID:iotaledger,項目名稱:android-wallet-app,代碼行數:19,代碼來源:AboutFragment.java

示例8: registerReceiverIgnoredReceiverHasRegisteredHereException

import android.util.AndroidRuntimeException; //導入依賴的package包/類
public static void
registerReceiverIgnoredReceiverHasRegisteredHereException(Context
                                                                  context, RecordOperationAppBroadcastReceiver broadcastReceiver,
                                                          IntentFilter intentFilter) {
    if (broadcastReceiver == null ||
            broadcastReceiver.hasRegistered() || intentFilter == null) {
        return;
    }
    try {
        context.getApplicationContext().registerReceiver(broadcastReceiver,
                intentFilter);
        broadcastReceiver.setHasRegistered(true);
    } catch
            (AndroidRuntimeException receiverHasRegisteredException) {
        receiverHasRegisteredException.printStackTrace();
    }
}
 
開發者ID:jas0nchen,項目名稱:X.Ray,代碼行數:18,代碼來源:Utility.java

示例9: requestFeature

import android.util.AndroidRuntimeException; //導入依賴的package包/類
@Override
public boolean requestFeature(int featureId) {
    if (DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId);

    if (mContentParent != null) {
        throw new AndroidRuntimeException("requestFeature() must be called before adding content");
    }

    switch (featureId) {
        case Window.FEATURE_ACTION_BAR:
        case Window.FEATURE_ACTION_BAR_OVERLAY:
        case Window.FEATURE_ACTION_MODE_OVERLAY:
        case Window.FEATURE_INDETERMINATE_PROGRESS:
        case Window.FEATURE_NO_TITLE:
        case Window.FEATURE_PROGRESS:
            mFeatures |= (1 << featureId);
            return true;

        default:
            return false;
    }
}
 
開發者ID:tamzi,項目名稱:sophia,代碼行數:23,代碼來源:ActionBarSherlockCompat.java


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