Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bffa1117 authored by Gary's avatar Gary Committed by Gerrit Code Review
Browse files

Add storage selection (2/2)

Change-Id: I364c9fd43c48195248d374e2f441fad2280aa4de
parent 835d769c
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -69,6 +69,26 @@ public class StateManager {
        if (mIsResumed) state.resume();
    }

    //Starts state without 'transitionOnNextPause'
    public void startStateNow(Class<? extends ActivityState> klass, Bundle data) {
        Log.v(TAG, "startStateNow " + klass);
        ActivityState state = null;
        try {
            state = klass.newInstance();
        } catch (Exception e) {
            throw new AssertionError(e);
        }
        if (!mStack.isEmpty()) {
            ActivityState top = getTopState();
            if (mIsResumed) top.onPause();
        }
        state.initialize(mActivity, data);

        mStack.push(new StateEntry(data, state));
        state.onCreate(data, null);
        if (mIsResumed) state.resume();
    }

    public void startStateForResult(Class<? extends ActivityState> klass,
            int requestCode, Bundle data) {
        Log.v(TAG, "startStateForResult " + klass + ", " + requestCode);