title: Android correct place to inflate custom view
body: <p>I have this custom view:</p>
  
  <pre><code>class BaseView extends FrameLayout() {
       @Override
       void onAttachedToWindow() {
           View.inflate(context, R.layout.view, this)
       }
  }
  </code></pre>
  
  <p>The correct place to inflate my custom view is in the onAttachedToWindow method?</p>
  
  <p>I am thinking that maybe inflating it after the onAttach can make the parent layout to be entire redraw.</p>
  
  <p>If it is wrong to inflate in the onAttachedToWindow, where is the right place?</p>
  
  <p>This view is added dynamically (via addView) and in others places it is placed in the xml definition.</p>