Back to project page ColorWallpaper.
The source code is released under:
Licensed under the Expat License. Copyright (C) 2013 Peter Occil Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the...
If you think the Android project ColorWallpaper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.upokecenter.android.ui; //w w w .j a v a 2s.co m import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.preference.Preference.BaseSavedState; final class PreferenceState extends BaseSavedState { Bundle bundle; Class<?> clazz; public PreferenceState(Parcel p) { super(p); bundle = p.readBundle(); clazz = (Class<?>)p.readSerializable(); } public PreferenceState(Parcelable state, Class<?> clazz) { super(state); this.clazz=clazz; bundle=new Bundle(); } public Bundle getBundle(){ return bundle; } @Override public String toString() { return "PreferenceState [bundle=" + bundle + ", clazz=" + clazz + "]"; } public static boolean isPreferenceState(Parcelable state, Class<?> clazz){ if(state!=null && (state instanceof PreferenceState)){ Class<?> otherClass=((PreferenceState)state).clazz; //DebugUtility.log("thisclass=%s otherclass=%s",clazz,otherClass); if(otherClass!=null && otherClass.equals(clazz)) return true; } return false; } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeBundle(bundle); dest.writeSerializable(clazz); } public static final Parcelable.Creator<PreferenceState> CREATOR = new Parcelable.Creator<PreferenceState>() { @Override public PreferenceState[] newArray(int size) { return new PreferenceState[size]; } @Override public PreferenceState createFromParcel(Parcel parcel) { return new PreferenceState(parcel); } }; }