title: refresh ListView after delete from database
body: <p>I have a ListView with a SimpleCursorAdapter,it load informations from a database,I want onlongclicklistener to delete an item from database,it works fine,but the list does not refreshes,I tried with listView.refreshDrawableState(); and some other methods that I found as answer but no one works,this is my onCreate function:</p>
  
  <pre><code>  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.layout_act);
      imzero = (ImageView)findViewById (R.id.iv_zero_pers);
      tvzero = (TextView)findViewById (R.id.tv_zero_pers);
      dbConnector = new DatabaseConnectorrso(MyListActivity.this);
      dbConnector.checkCursor();
      if (DatabaseConnector.de)//check if database is emplty
      {
      try{                
          dbConnector.open();             
          dbConnector.load();//load information from database
          dbConnector.close();
          imzero.setVisibility(View.GONE);
          tvzero.setVisibility(View.GONE);
      }
      catch(Exception ex) {
          ex.printStackTrace();
          dbConnector.close();
      }
      conAdapter =(new ImageAndTextAdapter(MyListActivity.this,
              R.layout.meniu_lista_element, null, null, null));
      setListAdapter(conAdapter);
      }
      else{
          dbConnector.close();
          imzero.setVisibility(View.VISIBLE);
          tvzero.setVisibility(View.VISIBLE);
      }
  </code></pre>
  
  <p>and I tried to refresh the list like this</p>
  
  <pre><code>   listView.setOnItemLongClickListener(new OnItemLongClickListener() {
          @Override
          public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              deleteDialog(Integer.parseInt (DatabaseConnector.id.get(position))); //delete from database 
              dbConnector.checkCursor();
              if (DatabaseConnector.de)
              {
              try{                
                  dbConnector.open();             
                  dbConnector.loadPersoane();
                  listView.refreshDrawableState();
                  dbConnector.close();
                  imzero.setVisibility(View.GONE);
                  tvzero.setVisibility(View.GONE);
              }
              catch(Exception ex) {
                  ex.printStackTrace();
                  dbConnector.close();
              }
              conAdapter =(new ImageAndTextAdapter(AltePersoane.this,
                      R.layout.meniu_lista_element, null, null, null));
              setListAdapter(conAdapter);
              }
              else{
                  dbConnector.close();
                  imzero.setVisibility(View.VISIBLE);
                  tvzero.setVisibility(View.VISIBLE);
              }
  
              return true;
          }
      }); 
  </code></pre>