title: How can i check boxes from simple_list_item_multiple_choice via retrieving data from a sharedPreferences?
body: <p>i'm pretty new to android-development and im trying to build a ListView with 8 items, that each have checkboxes. is set them up already, but i dont know how i can set one/several box beeing checked via retrieving key.value-pairs from a SharedPreferences.</p>
  
  <p>i think im pretty close, but there is one or two lines of code missing :(</p>
  
  <p>this my code in the onCreate-method:</p>
  
  <pre><code>lv = (ListView) findViewById(R.id.lvMain);
  
  getPreferences(MODE_PRIVATE).edit().putString("Spiel4", "yes").commit();
  
  lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_multiple_choice, lvItems));
  lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  
      for (int i=1;i&lt;9;i++) {
          tmpString = null;
          tmpString = getPreferences(MODE_PRIVATE).getString("Spiel"+i,"");
  
          if (tmpString.equals("yes")) {
              // -----&gt; MISSING LINE HERE &lt;-----
              Log.i(tag,"Spiel"+i+"-value is YES!");
          }
  
      }
  </code></pre>
  
  <p>p.s.: my first post, formatting tricked me :(</p>