title: How to update listview in AlertDialog
body: <p>I have a dialog that contains a listview, the data of the list view comes from the parent of the dialog. Every time the dialog is about to be displayed, it should get data from the activity to build its list items. I know I should do this in <strong>onPrepareDialog()</strong>, but I don't know how to update the listview created by <strong>AlertDialog.builder</strong>, Could anyone help me?</p>
  
  <p>My dialog is created from below code:</p>
  
  <pre><code>    new AlertDialog.Builder(this)
                  .setTitle(title)
                  .setMultiChoiceItems(cityNames(), updateSelections(),
                          new DialogInterface.OnMultiChoiceClickListener() {
                              public void onClick(DialogInterface dialog, int whichButton,  boolean isChecked) {
                                  if(isChecked){
                                      selections[whichButton] = true;
      //                              Toast.makeText(MainActivity.this, cities.get(whichButton).getName(), Toast.LENGTH_SHORT).show();
                                  }
                              }
                          })
                  .setPositiveButton("OK",
                          new DialogInterface.OnClickListener() {
                              public void onClick(DialogInterface dialog, int whichButton) {
                                  for(int i=0;i&lt;selections.length;i++){
                                      if(selections[i]==true){
                                          removeCityFromScreen(i);
                                      }
                                  }
                      }
                  })
                  .setNegativeButton("Cancel",
                          new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int whichButton) {
  
                      }
                  })
                 .create();
  </code></pre>