title: how to get the width of textView in android
body: <p>This is the code what i am using...</p>
  
  <pre><code>&lt;TextView
      android:id="@+id/textView"
      android:layout_width="100dp"
      android:layout_height="40dp"
      android:text="AMIT KUMAR" /&gt;
  </code></pre>
  
  <p>and here is a java code.</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      TextView textView = (TextView) findViewById(R.id.textView);
      Log.d("left", textView.getLeft() + " " + textView.getRight() + " "
              + textView.getWidth()+" "+textView.getHeight());
  }
  </code></pre>
  
  <p>for all above i am getting the output 0. </p>
  
  <p>so how can i get the width and height of textView.</p>