title: App crashes when AlertDialog is supposed to open for the second time
body: <p>When I long click a ListView item, it opens an AlertDialog with three buttons. One of them is "Rename" to rename the item etc. </p>
  
  <pre><code>longClickAlert.setNegativeButton("Rename", new DialogInterface.OnClickListener() {
  
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      renameAlert.setMessage("New name:");
                      renameAlert.setView(input);
                      renameAlert.setPositiveButton("Enter", new DialogInterface.OnClickListener() {
  
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              renameLine(externalStoragePath + "/Android/data/com.whizzappseasyvoicenotepad/recorded files.txt", recordedFilesArray.get(toDelete), input.getText().toString());
                              currentFilePath = externalStoragePath + File.separator + "/Android/data/com.whizzappseasyvoicenotepad/" + recordedFilesArray.get(toDelete) + ".mp3";
                              renameFile(input.getText().toString());
                              recordedFilesArray.set(toDelete, input.getText().toString());
                              listAdapter.notifyDataSetChanged();
                              dialog.dismiss();
                          }
                      });
                      renameAlert.show();
                      dialog.dismiss();
                  }
              });
  </code></pre>
  
  <p>This works fine, the item name and everything else is successfully changed, but it only works ONCE. When I rename the file and then try to rename anything again, the app crashes and this is the logcat file:</p>
  
  <pre><code>08-21 11:26:13.631: E/AndroidRuntime(7260): FATAL EXCEPTION: main
  08-21 11:26:13.631: E/AndroidRuntime(7260): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.view.ViewGroup.addViewInner(ViewGroup.java:3506)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.view.ViewGroup.addView(ViewGroup.java:3377)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.view.ViewGroup.addView(ViewGroup.java:3353)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at com.android.internal.app.AlertController.setupView(AlertController.java:413)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at com.android.internal.app.AlertController.installContent(AlertController.java:241)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.app.AlertDialog.onCreate(AlertDialog.java:337)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.app.Dialog.dispatchOnCreate(Dialog.java:355)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.app.Dialog.show(Dialog.java:260)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.app.AlertDialog$Builder.show(AlertDialog.java:951)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at com.whizzappseasyvoicenotepad.RecordedLibrary$3$2.onClick(RecordedLibrary.java:158)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.os.Handler.dispatchMessage(Handler.java:99)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.os.Looper.loop(Looper.java:137)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at android.app.ActivityThread.main(ActivityThread.java:5103)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at java.lang.reflect.Method.invokeNative(Native Method)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at java.lang.reflect.Method.invoke(Method.java:525)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  08-21 11:26:13.631: E/AndroidRuntime(7260):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>