title: Custom progressbar dialog with dialogFragment
body: <p>I'm new to android programming. I want to create a custom progress dialog with some textview and button and showing the progress with <strong>two progressBar</strong> and updating them while sending the files from <strong>Asynctask</strong>, Also I want it works with minimum API 10. google doc recommend me to use <strong>DialogFragment</strong> and i do not have any idea how to update the progress bars and textviews that are in that custom layout of my fragmentDialog, when I try to reference a textview or progress bar it throw null exeption</p>
  
  <p>Here is my code</p>
  
  <pre><code>public static class FireMissilesDialogFragment extends DialogFragment {
      public FireMissilesDialogFragment(){
      }
      public static FireMissilesDialogFragment newInstance(String title) {
          FireMissilesDialogFragment frag = new FireMissilesDialogFragment();
          Bundle args = new Bundle();
          args.putString("title", title);
          frag.setArguments(args);
          return frag;
      }
      @Override
      public Dialog onCreateDialog(Bundle savedInstanceState) {
          // Use the Builder class for convenient dialog construction
  
          AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
          // Get the layout inflater
          LayoutInflater inflater = this.getActivity().getLayoutInflater();
          // Inflate and set the layout for the dialog
          // Pass null as the parent view because its going in the dialog layout
  
          View view = inflater.inflate(R.layout.custom_progress, null);
          ProgressBar pbCurrent = (ProgressBar) view.findViewById(R.id.current);
  
          builder.setView(view);
  
          builder.setMessage("Fire Missiles")
          .setPositiveButton("Fire", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int id) {
                  // FIRE ZE MISSILES!
              }
          })
          .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int id) {
                  // User cancelled the dialog
              }
          });
          // Create the AlertDialog object and return it
          return builder.create();
      }
  }
  </code></pre>
  
  <p>I got a nullExeption here in my main activity when try to reference a view</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      Button frag = (Button) findViewById(R.id.frag);
      frag.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              FireMissilesDialogFragment fragment = FireMissilesDialogFragment.newInstance("hi") ;
              fragment.getActivity().findViewById(R.id.current);// nullExeption here
              //              downloadAsync as = new downloadAsync();
              //              as.execute();
  
          }
      });
  </code></pre>
  
  <p>I didn't see much question and example about that, did I go all the way wrong and should pick another way to achieve my point??!!</p>
  
  <p>Edit : 
  I'm trying to create something like <a href="http://i.i.cbsi.com/cnwk.1d/i/tim2/2013/05/09/ES_File_Explorer-_share_files.png" rel="nofollow">this</a> </p>
  
  <p>thanks in advance</p>