title: How do you delete a sharedPreference by clicking on a listView item?
body: <p>I have created a list that displays a shared preference as a string. I create it like this...</p>
  
  <pre><code>adapter = new ArrayAdapter&lt;String&gt;(this,
  android.R.layout.simple_list_item_1, listItems);
  setListAdapter(adapter);
  
  
  if (sharedpreferences.contains(Name0)) {
      String prefs = sharedpreferences.getString(Name0, "");
      listItems.add(prefs);
  }
  </code></pre>
  
  <p>and so on with other preferences. I am trying to figure out how to delete a list item, and the shared preference along with it as well. I can't figure out if I should use an onClick listener, or a delete button in the list or some other method I perhaps haven't read about. I'd like to make it very simple and intuitive for the user.</p>
  
  <p>So my question is, how can I edit my existing code to delete a list item and the preference that it is displaying. Thank you for any help.</p>