title: Java convert ArrayList to string and back to ArrayList?
body: <p>I wanted to save an ArrayList to SharedPreferences so I need to turn it into a string and back, this is what I am doing:</p>
  
  <pre><code>// Save to shared preferences
  SharedPreferences sharedPref = this.getPreferences(Activity.MODE_PRIVATE);
  SharedPreferences.Editor editor = this.getPreferences(Activity.MODE_PRIVATE).edit();
  editor.putString("myAppsArr", myAppsArr.toString());
  editor.commit();
  </code></pre>
  
  <p>I can retrieve it with <code>String arrayString = sharedPref.getString("yourKey", null);</code> but I don't know how to convert arrayString back into an ArrayList. How can it be done?</p>
  
  <hr>
  
  <p>My array looks something like:</p>
  
  <pre><code>[item1,item2,item3]
  </code></pre>