title: Android List view refresh
body: <p>I have one ListView which is showing me some data through an array (which is in another class and I'm accessing it through it's object). </p>
  
  <p>Whenever I delete an element from the ListView through context menu, the list is not refreshing but the element is deleted from the array. How can I refresh the list to show this?</p>
  
  <p>Code:</p>
  
  <pre><code>     public void onCreateContextMenu(ContextMenu menu, View v,
          ContextMenuInfo menuInfo) {
      if (v.getId()==R.id.mainListView) {
          AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;
          post=info.position;
        menu.setHeaderTitle(stocks[info.position]);
          String[] menuItems = stt;
          for (int i = 0; i&lt;menuItems.length; i++) {
              menu.add(Menu.NONE, i, i, menuItems[i]);
              }
      }
    }
  
       @Override
        public boolean onContextItemSelected(MenuItem item) {
          AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
          int menuItemIndex = item.getItemId();
          String[] menuItems = stt;
          String menuItemName = menuItems[menuItemIndex];
          listItemName = stocks[info.position];
          stockname.remove(post-1);
  
      return true;
    }
  </code></pre>