How can i refresh listview in android?
<p>This is my code :
Here _alProduct is an ArrayList defined static in the main class.
I am deleting an item from _alProduct on long click of listview.
Now I want to display the listview with the deleted item removed.</p>

<p>public class MCRActivity2 extends Activity {</p>

<pre><code>TextView tvShoppingCart;
ListView lvSelectedItems;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mcractivity2);

    lvSelectedItems = (ListView) findViewById(R.id.lvSelectedItems);

    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getApplicationContext(), android.R.layout.simple_list_item_1, MobileCashRegisterActivity._alProduct);

    lvSelectedItems.setAdapter(adapter);

    lvSelectedItems.setOnItemLongClickListener(new OnItemLongClickListener() {

        public boolean onItemLongClick(AdapterView&lt;?&gt; adapter, View view,
                int position, long arg3) {
            // TODO Auto-generated method stub  
            String text = "Clicked item is " + adapter.getItemAtPosition(position);

            Toast.makeText(getApplicationContext(),text,Toast.LENGTH_LONG).show();//    ""+ lvSelectedItems.getSelectedItem().toString(),Toast.LENGTH_LONG).show();

            MobileCashRegisterActivity._alProduct.remove(position);
            MobileCashRegisterActivity._alPrice.remove(position);
            MobileCashRegisterActivity._alQuantity.remove(position);

            return false;
        }
    });
    }
}
</code></pre>
