title: Change Custom ListView Item programmatically
body: <p>I have a custom listview with three items. One of them is like "Add this to the DB" and when I click to it it inserts something to the DB. </p>
  
  <p>What I want it to do is after doing the insert, change the text to "Delete this from the DB" and also the <code>onClick</code> method to call a method to delete that record instead a method to insert.
  Is this possible?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>final String[] opcs = new String[]{"Resultados", "Clasificación", text_fav};
  
        ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(this, R.layout.list_menutipo_item, opcs);
        m_list.setAdapter(aa);          
        m_list.setOnItemClickListener(new OnItemClickListener() {
  
            @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                    int position, long id) {
                  Intent newActivity = null;
                  switch( position )
                  {                  
                      case 0:  ...
  
  
                      case 2:  if (isConnected(m_context))
                       {
                          añadirFavorito();
                       }
                      break;  
                  }
              }   
          });    
  </code></pre>