Example usage for android.os Parcelable getClass

List of usage examples for android.os Parcelable getClass

Introduction

In this page you can find the example usage for android.os Parcelable getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.github.preferencefragment.preference.MyPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (!state.getClass().equals(SavedState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;//ww w .  j  a v  a 2 s  .c o m
    }

    // Restore the instance state
    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    mClickCounter = myState.clickCounter;
    notifyChanged();
}

From source file:android.support.v7.preference.EditTextPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;// w w  w  . j  a  va2s.  c o  m
    }

    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    setText(myState.text);
}

From source file:paulscode.android.mupen64plusae.preference.PlayerMapPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedStringState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;//from   w  w  w  . ja va  2s  .  c  om
    }

    final SavedStringState myState = (SavedStringState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    mMap.deserialize(myState.mValue);
    updateViews();
}

From source file:tk.wasdennnoch.androidn_ify.ui.emergency.preferences.ContactPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;//from   w w w  .j a va  2  s . c o m
    }
    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    if (myState.isDialogShowing) {
        showRemoveContactDialog(myState.dialogBundle);
    }
}

From source file:com.android.settings.SeekBarPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (!state.getClass().equals(SavedState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;//from w  ww .  j a v  a 2  s. c om
    }

    // Restore the instance state
    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    mProgress = myState.progress;
    mMax = myState.max;
    notifyChanged();
}

From source file:paulscode.android.mupen64plusae.preference.PathPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedStringState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;//from w  ww. ja  v a  2  s.  c o  m
    }

    final SavedStringState myState = (SavedStringState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    populate(myState.mValue);
}

From source file:android.support.v7.preference.ListPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;//  w  w w.  j a  va2  s . c  o  m
    }

    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    setValue(myState.value);
}

From source file:com.esminis.server.library.activity.DrawerFragment.java

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        Bundle bundle = savedInstanceState.getBundle("android:preferences");
        if (bundle != null) {
            try {
                Parcelable parcelable = bundle.getParcelable("modules");
                if (parcelable != null) {
                    Field field = parcelable.getClass().getDeclaredField("dialogBundle");
                    field.setAccessible(true);
                    Bundle bundleTemp = (Bundle) field.get(parcelable);
                    if (bundleTemp != null) {
                        bundleTemp.setClassLoader(getClass().getClassLoader());
                    }/*ww  w  .j a  v a  2 s  .  c  om*/
                }
            } catch (Throwable ignored) {
            }
        }
    }
    super.onActivityCreated(savedInstanceState);
    if (getView() == null) {
        return;
    }
    View view = getView().findViewById(android.R.id.list);
    if (view == null) {
        return;
    }
    TypedValue attribute = new TypedValue();
    getActivity().getTheme().resolveAttribute(android.R.attr.windowBackground, attribute, true);
    if (attribute.resourceId > 0) {
        view.setBackgroundColor(ContextCompat.getColor(getActivity(), attribute.resourceId));
    }
}

From source file:android.support.v14.preference.MultiSelectListPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;/*w w w  . j  a  v  a  2s .co  m*/
    }

    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    setValues(myState.values);
}

From source file:paulscode.android.mupen64plusae.preference.SeekBarPreference.java

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedIntegerState.class)) {
        // Didn't save state for us in onSaveInstanceState
        super.onRestoreInstanceState(state);
        return;/*from  w w  w  . ja  v a 2  s.co  m*/
    }

    final SavedIntegerState myState = (SavedIntegerState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    if (mSeekBar != null)
        mSeekBar.setProgress(myState.mValue - mMinValue);
}