title: Refresh Firebase data on android listview
body: <p>In my android app i have a listview with item from firebase database. When i am deleting an item from the listview it also deleted from firebase database correctly. The problem is that i don't know who to refresh the listview after the action of delete. Can anyone help me to retrieve data after delete?</p>
  
  <p>This is the code of deleting item from listview</p>
  
  <pre><code>mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
          @Override
          public boolean onItemLongClick(final AdapterView&lt;?&gt; parent, View view, final int position, long id) {
  
  
              final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MainActivity.this);
              dialogBuilder.setTitle("Delete List___" );
              dialogBuilder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
  
                      Post post = (Post)parent.getItemAtPosition(position);
  
                      DatabaseReference del = FirebaseDatabase.getInstance().getReference().child("user-posts").child(getUid())
                              .child(post.getPostId());
  
                      del.setValue(null);
  
  
                  }
              });
  
              dialogBuilder.show();
              return false;
          }
      });
  </code></pre>
  
  <p>And this the code when i am retrieving data from database.</p>
  
  <pre><code>mDatabase.child(getUid()).addChildEventListener(new ChildEventListener() {
          @Override
          public void onChildAdded(DataSnapshot dataSnapshot, String s) {
  
              Post post = dataSnapshot.getValue(Post.class);
              mAdapter.add(post);
  
          }
  
          @Override
          public void onChildChanged(DataSnapshot dataSnapshot, String s) {
  
              Log.d(TAG,"dataCHANGE");
          }
  
          @Override
          public void onChildRemoved(DataSnapshot dataSnapshot) {
  
  
              Log.d(TAG,"dataREMOVE "+ dataSnapshot.getKey());
          }
  
          @Override
          public void onChildMoved(DataSnapshot dataSnapshot, String s) {
  
              Log.d(TAG,"dataMOVE");
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
  
          }
      });
  </code></pre>