title: Android : Deleting an item from listview as well as database
body: <p>I have a listview in which i am adding the items whose values are retrieved from the table in my database. Now, in the current scenario, if i am deleting an item, i am passing the complete string and breaking it in parts to provide information to my delete query. </p>
  
  <p>Instead of all these dumb work, i can simply pass the id of that particular item, but the id is not in the string array which is binded to the listview. How can i delete items from the database by simply using the item's id...? </p>
  
  <p>Note: id is the column in table, so i have each item's id from database. But i am not displaying it in the listview. </p>
  
  <pre><code>   String[] records = new String[report.size()];
          for(int i = 0; i&lt;report.size(); i++)
          {
              if(report.get(i).getDate()!="")
              {
                  String eachRecord = (i+1) +". "+report.get(i).getDate() + " -- " + report.get(i).getType();
                  records[i] = eachRecord;
              }
  
          }
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.singlerow, records);
          listView.setAdapter(adapter);
  </code></pre>