title: How to refresh the ListView after change the data with the DialogFragment?
body: <p>I create a custom dialog with DialogFragment, and in the dialog, I can add some data to the SQLite database. Also, there is a listview in the main activity, which show the data of the SQLite.</p>
  
  <p>I want to refresh the listview when I add the data to the database from the dialog. However, I have some problems.</p>
  
  <p>I call the notifyDataSetChanged() in the onResume(), but the listview doesn't refresh when I dismiss the dialog. And if I press the home button and open the activity from the recent list, the listview will refresh.</p>
  
  <pre><code>@Override
  protected void onResume() {
      super.onResume();
      listItem.clear();
      ServerListDB db = new ServerListDB(context);
      Cursor cursor = db.select();
      for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
          HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
          map.put("serverName", String.valueOf(cursor.getString(1)));
          map.put("serverIp", cursor.getString(2));
          map.put("serverPort", cursor.getString(3));
          listItem.add(map);
      }
      notifyDataSetChanged();
  }
  </code></pre>
  
  <p>I add the log.v in the onPause(), and when the dialog show, the onPause() isn't called. Is this right for DialogFragment?</p>
  
  <pre><code>@Override
  protected void onPause() {
      super.onPause();
      Log.v("Pause", "onPause() called!");
  }
  </code></pre>