title: DialogFragment instances - assign different actions
body: <p>I am having lots of issues understanding how DialoFragment works.</p>
  
  <p>I need to generate 6 similar structured AlertDialog in my Fragment when clicking 6 different action buttons. Only thing is, the Dialog's PositiveButton onClick event will be different on each case (based on which action button was clicked).</p>
  
  <p>Instead of writing same lines of codes 6 times, I was trying to use DIalogFragment. So far, i have come to the point that I can successfully display 6 different alerts, but still can't make a way of assigning different tasks to them. Any help will be appreciated.</p>
  
  <pre><code>public class AlertDialogSingleField extends DialogFragment{
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          Bundle args = getArguments();
          String title = args.getString("title");
          AlertDialog.Builder myDialog = new AlertDialog.Builder(getActivity());
          LayoutInflater inflater = getActivity().getLayoutInflater();
          View layout = inflater.inflate(R.layout.single_field_alert, null);
          myDialog.setView(layout);
          myDialog.setTitle(title);
  
          myDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int which) {
                  //ACTIONS HERE WILL BE DIFFERENT DEPENDING ON WHICH METHOD WAS CALLED TO CREATE THIS DIALOG
              }
          });
          return myDialog.create();
      }
  
      public Interface testActions{
          public void ActionForalert1();
          public void ActionForalert2();
      }
  }
  
  public class ImportExportFragment extends Fragment implements testActions{
      public void alert1(){
          DialogFragment alertdialog = new AlertDialogSingleField();
          Bundle args = new Bundle();
          args.putString("title", "Title1");
          alertdialog.setArguments(args);
          alertdialog.show(getFragmentManager(), "alert1");
      }
  
      public void alert2(){
          DialogFragment alertdialog = new AlertDialogSingleField();
          Bundle args = new Bundle();
          args.putString("title", "Title2");
          alertdialog.setArguments(args);
          alertdialog.show(getFragmentManager(), "alert2");
      }
  
      public void ActionForalert1(){
          //THINGS TO DO WHEN AlertDialog created through alert1 method
      }
  
      public void ActionForalert2(){
          //THINGS TO DO WHEN AlertDialog created through alert2 method
      }
  }
  </code></pre>