title: onCreateView Fragment not called
body: <p>I have a custom <code>DialogFragment</code>  with a <code>FrameLayout</code> container in which I want to put a <code>Fragment</code> but its view always return <code>null</code>, what can I do?</p>
  
  <p>In <code>DialogCreateAccount.java</code></p>
  
  <pre><code>   public class DialogCreateAccount extends DialogGeneral implements OnClickListener{
  
     @Override
     public Dialog onCreateDialog(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
  
      Dialog dialog = super.onCreateDialog(savedInstanceState);
  
      //........
  
  
      return dialog;
  
     }
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
  
       Fragment fragment = CreateAccountFragment.newInstance();
  
  
       FragmentTransaction ft = getFragmentManager().beginTransaction();
  
           if(fragment.getView()!=null){ // return always null
  
              ft.add(
                      getFrameContainer().getId(),
                      fragment
                      )
              .commit();
           }else{
  
           }
  
          Log.i("DialogCreateAccount", "fragment:" +fragment.getView());// return null
    }
  </code></pre>
  
  <p>In CreateAccountFragment.java</p>
  
  <pre><code> public class CreateAccountFragment extends Fragment implements OnClickListener{
  
          public CreateAccountFragment() {
            // TODO Auto-generated constructor stub
  
          }
  
         public static CreateAccountFragment newInstance() {
  
               CreateAccountFragment f = new CreateAccountFragment();
  
               return f;
         }
  
         @Override
         public void onCreate(Bundle savedInstanceState) {
              // TODO Auto-generated method stub
           super.onCreate(savedInstanceState);
           Log.i("CreateAccountFragment", "onCreate");
           //onCreate is called
  
  
         }
  
         @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
            // TODO Auto-generated method stub
  
        Log.i("CreateAccountFragment", "onCreateView");
          //onCreateView not called
  
            mRootView = inflater.inflate(R.layout.dialog_create_an_account, container, false);
  
  
  
  
            return mRootView;
  
  
         }
        }
  </code></pre>
  
  <p>In Fragment <code>onCreate</code> is called and <code>onCreateView</code> is not called.</p>