title: Dialog-fragments getView() returns null when called from outside
body: <p>I have a problem when trying to access my dialogs fragments view. 
  Here is what I do:</p>
  
  <p>For each button in my main activity I create a new dialogFragment when the button is clicked:</p>
  
  <pre><code>    button.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  DialogFragment newFragment = ResAmountDialog.newInstance(R.string.res_dialog_title);
                  newFragment.show(getFragmentManager(), "dialog");
                  ImageView resIcon = (ImageView) newFragment.getView().findViewById(R.id.resourceIcon1);
                  resIcon.setImageResource(currentResourceImage);
              }
      });
  </code></pre>
  
  <p>The dialog fragment consists of an EditText and ImageView. I'm trying to access the imageView in the above code by getting the fragment, then its view and then finding it by ID, but it returns null.</p>
  
  <p>I tried to find a solution on the internet but all the similar problems had their views accessed within the fragment, i try to access it from outside.</p>