Example usage for android.util SuperNotCalledException SuperNotCalledException

List of usage examples for android.util SuperNotCalledException SuperNotCalledException

Introduction

In this page you can find the example usage for android.util SuperNotCalledException SuperNotCalledException.

Prototype

public SuperNotCalledException(String msg) 

Source Link

Usage

From source file:android.app.Activity.java

final void performStart() {
    mFragments.noteStateNotSaved();//  w  ww .ja v  a2 s.c  om
    mCalled = false;
    mFragments.execPendingActions();
    mInstrumentation.callActivityOnStart(this);
    if (!mCalled) {
        throw new SuperNotCalledException(
                "Activity " + mComponent.toShortString() + " did not call through to super.onStart()");
    }
    mFragments.dispatchStart();
    if (mAllLoaderManagers != null) {
        final int N = mAllLoaderManagers.size();
        LoaderManagerImpl loaders[] = new LoaderManagerImpl[N];
        for (int i = N - 1; i >= 0; i--) {
            loaders[i] = mAllLoaderManagers.valueAt(i);
        }
        for (int i = 0; i < N; i++) {
            LoaderManagerImpl lm = loaders[i];
            lm.finishRetain();
            lm.doReportStart();
        }
    }
}

From source file:android.app.Activity.java

final void performRestart() {
    mFragments.noteStateNotSaved();/*  w  ww  . j  a  va2  s  .  c  o m*/

    if (mStopped) {
        mStopped = false;
        if (mToken != null && mParent == null) {
            WindowManagerGlobal.getInstance().setStoppedState(mToken, false);
        }

        synchronized (mManagedCursors) {
            final int N = mManagedCursors.size();
            for (int i = 0; i < N; i++) {
                ManagedCursor mc = mManagedCursors.get(i);
                if (mc.mReleased || mc.mUpdated) {
                    if (!mc.mCursor.requery()) {
                        if (getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
                            throw new IllegalStateException(
                                    "trying to requery an already closed cursor  " + mc.mCursor);
                        }
                    }
                    mc.mReleased = false;
                    mc.mUpdated = false;
                }
            }
        }

        mCalled = false;
        mInstrumentation.callActivityOnRestart(this);
        if (!mCalled) {
            throw new SuperNotCalledException(
                    "Activity " + mComponent.toShortString() + " did not call through to super.onRestart()");
        }
        performStart();
    }
}

From source file:android.app.Activity.java

final void performResume() {
    performRestart();//w ww . j  a v a  2  s. c  o  m

    mFragments.execPendingActions();

    mLastNonConfigurationInstances = null;

    mCalled = false;
    // mResumed is set by the instrumentation
    mInstrumentation.callActivityOnResume(this);
    if (!mCalled) {
        throw new SuperNotCalledException(
                "Activity " + mComponent.toShortString() + " did not call through to super.onResume()");
    }

    // Now really resume, and install the current status bar and menu.
    mCalled = false;

    mFragments.dispatchResume();
    mFragments.execPendingActions();

    onPostResume();
    if (!mCalled) {
        throw new SuperNotCalledException(
                "Activity " + mComponent.toShortString() + " did not call through to super.onPostResume()");
    }
}

From source file:android.app.Activity.java

final void performPause() {
    mDoReportFullyDrawn = false;//from w w  w  .  j a  va2s.c  o  m
    mFragments.dispatchPause();
    mCalled = false;
    onPause();
    mResumed = false;
    if (!mCalled && getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.GINGERBREAD) {
        throw new SuperNotCalledException(
                "Activity " + mComponent.toShortString() + " did not call through to super.onPause()");
    }
    mResumed = false;
}

From source file:android.app.Activity.java

final void performStop() {
    mDoReportFullyDrawn = false;/*from   w ww  . ja v  a  2s.  c om*/
    if (mLoadersStarted) {
        mLoadersStarted = false;
        if (mLoaderManager != null) {
            if (!mChangingConfigurations) {
                mLoaderManager.doStop();
            } else {
                mLoaderManager.doRetain();
            }
        }
    }

    if (!mStopped) {
        if (mWindow != null) {
            mWindow.closeAllPanels();
        }

        if (mToken != null && mParent == null) {
            WindowManagerGlobal.getInstance().setStoppedState(mToken, true);
        }

        mFragments.dispatchStop();

        mCalled = false;
        mInstrumentation.callActivityOnStop(this);
        if (!mCalled) {
            throw new SuperNotCalledException(
                    "Activity " + mComponent.toShortString() + " did not call through to super.onStop()");
        }

        synchronized (mManagedCursors) {
            final int N = mManagedCursors.size();
            for (int i = 0; i < N; i++) {
                ManagedCursor mc = mManagedCursors.get(i);
                if (!mc.mReleased) {
                    mc.mCursor.deactivate();
                    mc.mReleased = true;
                }
            }
        }

        mStopped = true;
    }
    mResumed = false;
}