title: Android : Activity onviewcreated
body: <p>My activity have some fragments in a linearLayout (R.id.liste, inside a scrollView) and it takes some time to show.
  I reduced the size of the array to 50 but it was first 350.
  Each fragment is independent since I need them to respond to click and to pop a dialog up.</p>
  
  <p>Here is the code : </p>
  
  <pre><code>long start= System.currentTimeMillis();
  for (Item item : dao.getList(triKey, start, end)) {
      ItemFragment fragment = ItemFragment.newInstance(item);
      FragmentTransaction fragTransaction = fragMan.beginTransaction();
      fragTransaction.add(R.id.liste, fragment);
      fragTransaction.commit(); 
  }
  long time = System.currentTimeMillis()-start;
  </code></pre>
  
  <h3>Real question :</h3>
  
  <p>I would like to show a circle progressBar and set it Gone when all fragments are shown, but Activity doesn't have a onViewCreated() method, is there any workaround ?</p>
  
  <h3>Deeper, theoric question :</h3>
  
  <p>If I override Activity.onCreateView() and use the System.currentTimeMillis(), I see that it takes 7.5 seconds to show 50 fragments on my Nexus 4 (and 20s for 350 fragments).
  Since each fragment only holds 5 TextViews and 1 ProgressBar and takes like 10-15ms to create its view, I'm surprised it takes so long, why does it take nearly 6x more time to add the fragment than to draw it ?</p>
  
  <p>I dont know which piece of code you would need to answer, feel free to ask of course !</p>
  
  <p>Thank you very much for any help !</p>