title: Android : holder.getSurface() always return null
body: <p>My view is a bunch of normal widget and a surfaceview. I don't know why after I get <code>surfaceholder</code> of SurfaceView and use <code>getSurface()</code> again on holder, I will always return null.</p>
  
  <p>Here is my example code :</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.view);
      }
  
      @Override
      public void onResume() {
          super.onResume();
          surface = (SurfaceView) findViewById(R.id.surfaceView);
          this.holder = surface.getHolder();
  
           if (holder.getSurface().isValid()){  // get surface again
               Log.i("Notice","Surface holder is valid");
           }
           else
               Log.i("Notice","Surface holder ISNOT valid");  //Always receive this
          }
  </code></pre>
  
  <p>When I see Android document for <code>getSurface()</code> method.  This is how it say:</p>
  
  <blockquote>
    <p>Direct access to the surface object. The Surface may not always be
    available -- for example when using a SurfaceView the holder's Surface
    is not created until the view has been attached to the window manager
    and performed a layout in order to determine the dimensions and screen
    position of the Surface. You will thus usually need to implement
    Callback.surfaceCreated to find out when the Surface is available for
    use.</p>
  </blockquote>
  
  <p>I don't understand this so much but I know I have miss something. Please explain for me, and tell me about <code>Callback.surfaceCreated</code> means, and how to implement it ?</p>
  
  <p>Thanks :)</p>