title: show shared preference value in a listview
body: <p>I have a database in my android app which contain 2 fields named "word" and "meaning".From this database, i can retrieve data(word,meaning) and then  i have to save them to shared preference and these saved shared preferences will be showed in a listview. These are my goals. </p>
  
  <p>Now,only I can retrieve data from the database and can show them into a list view.For this my codes were: </p>
  
  <pre><code>ArrayList&lt;HashMap&lt;String, String&gt;&gt; list_of_wordmeanings = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
       Cursor mCursor = mDbHelper.learn_getTestData();
  
      for (int i = 0; i &lt; mCursor.getCount(); i++) 
      {
          mCursor.moveToPosition(i);
  
          String string = mCursor.getString(1);           
  
          HashMap&lt;String, String&gt; hm = new HashMap&lt;String, String&gt;();
  
              String word = mCursor.getString(0).toString();
              String meaning = mCursor.getString(1).toString();
  
               hm.put("key_word",word);
               hm.put("key_meaning",meaning);
  
               list_of_wordmeanings.add(hm);
      }
  
              String[] from = { "key_word","key_meaning" };
              int[] to = { R.id.txt1,R.id.txt2};           
              SimpleAdapter adapter = new SimpleAdapter(getBaseContext(), list_of_wordmeanings, R.layout.list_layout, from, to);
             listView.setAdapter(adapter);
  </code></pre>
  
  <p>I also can save data into shared preference like this:</p>
  
  <pre><code>SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
      SharedPreferences.Editor editor = sharedPreferences.edit();
      editor.putString(key, value);
      editor.commit();
  </code></pre>
  
  <p>But i dont understand how to save these two fields(word,meaning) into a list of shared preference  and show them(the shared preference list) into a listview.
  Can anyone help me how to do this???</p>