title: Android DialogFragment onResume can't access views?
body: <p>I'm probably doing this in the wrong place, but currently I have a DialogFragment that represents a dialog with a camera button (among other things) and I'm using the built-in camera app (calling via an Intent) that returns to the DialogFragment's onActivityResult().</p>
  
  <p>This all works great, but my goal is to find an attachments LinearLayout in my dialog and essentially attach a copy of the captured image to it. e.g. you takes some pics and they appear in the dialog's "attachments" section.</p>
  
  <p>The issue appears to be that when the DialogFragment's onActivityResult() is triggered, I'm unable to get the its view, it's null:</p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == CAMERA_PIC_REQUEST &amp;&amp; resultCode == Activity.RESULT_OK) {
                 try {
                    LinearLayout attachments = (LinearLayout) getView().findViewById(R.id.landmarkAttachmentView); // &lt;- getView() is null
  </code></pre>
  
  <p>I threw in a debug log in a couple of suspect methods I thought might trigger when the camera returned, that had the DialogFragment's view available, but none of them logged:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
      Log.d(TAG, "Creating landmark dialog view");
      if(getView() == null) Log.d(TAG, "No view!");
      return super.onCreateView(inflater, container, savedInstanceState);
  }
  
  @Override
  public void show(FragmentManager manager, String tag) {
      Log.d(TAG, "Show landmark dialog view");
              if(getView() == null) Log.d(TAG, "No view!");
      super.show(manager, tag);
  }
  
  @Override
  public void onViewStateRestored(Bundle savedInstanceState) {
      Log.d(TAG, "Restored landmark dialog view");
              if(getView() == null) Log.d(TAG, "No view!");
      super.onViewStateRestored(savedInstanceState);
  }
  
  public void onResume() {
      Log.d(TAG, "Resume landmark dialog view");
              if(getView() == null) Log.d(TAG, "No view!");
      super.onResume();
  }
  
  @Override
  public void onStart() {
      Log.d(TAG, "Start landmark dialog view");
              if(getView() == null) Log.d(TAG, "No view!");
      super.onStart();
  }
  </code></pre>
  
  <p>Only onStart and onResume triggered but this.view was null. How can I get my DialogFragment's view after it's returned from another activity/fragment?</p>
  
  <p>Thanks!</p>