Пример #1
0
 /**
  * Load the item from {@link SharedPreferences}.
  *
  * @param pref
  * @param key
  */
 public void load(final SharedPreferences pref, final String key) {
   this.enabled = pref.getBoolean(String.format(SAVE_KEY_ENABLED, key), false);
   this.content = pref.getString(String.format(SAVE_KEY_CONTENT, key), null);
   this.rawCache = pref.getString(String.format(SAVE_KEY_RAW, key), null);
   this.rawContent = ClipDataHelper.clipDataFromString(rawCache);
 }
Пример #2
0
 /**
  * Load the item from {@link Bundle}.
  *
  * @param bundle
  * @param key
  */
 public void load(final Bundle bundle, final String key) {
   this.enabled = bundle.getBoolean(String.format(SAVE_KEY_ENABLED, key), false);
   this.content = bundle.getString(String.format(SAVE_KEY_CONTENT, key), null);
   this.rawCache = bundle.getString(String.format(SAVE_KEY_RAW, key), null);
   this.rawContent = ClipDataHelper.clipDataFromString(this.rawCache);
 }
Пример #3
0
 /**
  * Set the raw {@link ClipData} instance by its string form.
  *
  * @param rawContentString
  */
 public void setRawContent(String rawContentString) {
   this.rawCache = rawContentString;
   this.rawContent = rawCache == null ? null : ClipDataHelper.clipDataFromString(rawContentString);
 }