Code example for LinkedHashSet

Methods: addAll

0
    } 
  } 
   
  public void saveCustomList() { 
    // remove dup 
    LinkedHashSet<String> set = new LinkedHashSet<String>();
    set.addAll(mCustom);
    mCustom.clear();
    mCustom.addAll(set);
     
    try { 
      FileOutputStream fos = mContext.openFileOutput(CUSTOM_LIST_FILE, 
          Context.MODE_PRIVATE);
      String yaml = mYaml.dump(mCustom);
      fos.write(yaml.getBytes());
      fos.close();
       
      // backup to external storage 
      if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
        // We can read and write the media 
Contextual code suggestions in your IDE  Get Codota for Java