title: android - removing item from ListView on long click
body: <p>I'm having some troubles while trying to remove an item from the list view on long click. Below is the code:</p>
  
  <pre><code>public class MListViewActivity extends ListActivity {
  
  private ListView lv;
  private String[] some_data = null;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      some_data = getResources().getStringArray(R.array.mdata);
  
      // Bind resources Array to ListAdapter
      ArrayAdapter&lt;String&gt; myAdapter = new ArrayAdapter&lt;String&gt;(this,
              R.layout.list_item, R.id.label, some_data);
      this.setListAdapter(myAdapter);
  
      lv = getListView();
      lv.setDividerHeight(3);
  
      lv.setOnItemLongClickListener(new OnItemLongClickListener() {
  
          @Override
          public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view,
                  int arg2, long arg3) {
  
              // Can't manage to remove an item here
  
              return false;
          }
      });
  }
  </code></pre>
  
  <p>Any help is appreciated</p>