Example usage for android.app Fragment onResume

List of usage examples for android.app Fragment onResume

Introduction

In this page you can find the example usage for android.app Fragment onResume.

Prototype

@CallSuper
public void onResume() 

Source Link

Document

Called when the fragment is visible to the user and actively running.

Usage

From source file:com.tapchatapp.android.app.ui.TapchatFragmentStatePagerAdapter.java

@Override
public void restoreState(Parcelable state, ClassLoader loader) {
    if (state != null) {
        Bundle bundle = (Bundle) state;/*from   w  w  w . j a v a  2 s  . c  om*/
        bundle.setClassLoader(loader);
        Parcelable[] fss = bundle.getParcelableArray("states");
        mSavedState.clear();
        mFragments.clear();
        if (fss != null) {
            for (int i = 0; i < fss.length; i++) {
                mSavedState.add((Fragment.SavedState) fss[i]);
            }
        }
        Iterable<String> keys = bundle.keySet();
        for (String key : keys) {
            if (key.startsWith("f")) {
                int index = Integer.parseInt(key.substring(1));
                Fragment f = mFragmentManager.getFragment(bundle, key);
                if (f != null) {
                    while (mFragments.size() <= index) {
                        mFragments.add(null);
                    }
                    f.setMenuVisibility(false);
                    mFragments.set(index, f);
                    f.onResume();
                } else {
                    if (DEBUG)
                        Log.w(TAG, "Bad fragment at key " + key);
                }
            }
        }
    }
}