title: Execute a method after an activity is visible to user
body: <p>I have an activity contains too many UI controls.  I want to execute a method after make the activity visible.</p>
  
  <p><strong>An example i tried:</strong></p>
  
  <pre><code>public class Main extends Activity{
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);
               MyMethod();
      }
  
      private void MyMethod(){
          Toast.makeText(this, "Hi UI is fully loaded", Toast.LENGTH_SHORT).show();
      }
  }
  </code></pre>
  
  <p>But in the above sample, the message shows before the activity is visible.</p>
  
  <p>Is there a way to find out, if the activity is fully visible ?</p>