title: Are Activity faster to create than fragment?
body: <p>I had a layout for <code>Fragment</code> to show information about a product but sadly, during the creation of <code>fragment</code> there was <strong>slight lag( glitch)</strong> of around 50ms (that is what I guess how log the lag is  which is a lot as the refresh rate for android is 16ms) but when I use the same layout in <code>Activity</code> <strong>directly</strong> and <strong>applied the same logic</strong> it looked and felt smooth.</p>
  
  <p>Are there any particular reasons for this case ?
  Are there any way to make fragment look as smooth as activity during creation ?</p>
  
  <p>You can test some complex layout and try inflate it as fragment's view and using same as layout content for activity. </p>
  
  <p>This is how my oncreate looks like in both fragment and activity:</p>
  
  <pre><code>@Override
  public void onCreate ( Bundle savedInstanceState ) {  // or equivalent  override for fragment.
      super.onCreate ( savedInstanceState );
      setContentView ( R.layout.fragment_product_profile );
      initLayout ();
      loadData ();
      initCustomMadeImageSlider ();
      autoScrollViewPager ();
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Ansqo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ansqo.png" alt="This is the general idea about the UI"></a></p>