title: Android TextView.getLayout() returns null
body: <p>I get null in Layout object which I try to obtain from a Textview each time after configuration change.
  The method containing the code is called from onResume().</p>
  
  <p>I suspect I need to do some additional setup for it.</p>
  
  <p>I have studied similar questions, but there isn't a clear answer to it.</p>
  
  <p>What is the event which signals that Layout is ready after configuration changes?
  Is there some documentation for it?</p>
  
  <p><strong>EDITED</strong>:</p>
  
  <pre><code>public class BookDisplayAct extends Activity implements View.OnClickListener {
  ...
  private TextView textView;
  @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          textView = (TextView) findViewById(R.id.textViewMain);
          textView.setPadding(15, 15, 15, 15);
  ...
  }
  
  @Override
      protected void onResume() {
  ...
      renderBookView();
  }
  
      public void renderBookView() {
  ...
      justifyText(spannable, textView);
  ...
  
  }
  
      private Spannable justifyText(Spannable spannable, TextView textView) {
      Layout layout = textView.getLayout();
      int line_count = layout.getLineCount();
  ...
  }
  </code></pre>
  
  <p>I get the NullPointer exception with the last line.</p>