title: android.widget.TextView.setTextAlignment(): java.lang.NoSuchMethodError
body: <h1>Situation:</h1>
  
  <p>I have a <code>TextView</code> that have the property</p>
  
  <pre><code>android:textAlignment="center"
  </code></pre>
  
  <p>I am generating another <code>TextView</code> dinamically, based on my <code>TextView</code> from XML Layout, using a clone, cloning all the basic properties to work the way above.</p>
  
  <h1>Problem:</h1>
  
  <p>To do this i need to use this method:
  </p>
  
  <pre><code>this.myTextView.setMyTextViewProperty(MyTextView.getMyTextViewProperty());
  </code></pre>
  
  <p>for example:</p>
  
  <pre><code>this.MyTextView.setText(MyTextView.getText());
  </code></pre>
  
  <blockquote>
    <p>Note that <code>this.MyTextView</code>is a local variable and <code>MyTextView</code> is a private var declared on the top of the file, under class name.</p>
  </blockquote>
  
  <p>I do this on all the properties of the <code>TextView</code> but when i hit the following line of code from the <code>TextAlignment</code> property...:
  </p>
  
  <pre><code>this.myTextView.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
  </code></pre>
  
  <p>I tried to set it to a Custom Aligment instead of getting from my XML <code>TextView</code> It gives me an error:</p>
  
  <pre><code>11-20 15:27:04.460: E/AndroidRuntime(9185): FATAL EXCEPTION: main
  11-20 15:27:04.460: E/AndroidRuntime(9185): java.lang.NoSuchMethodError: android.widget.TextView.setTextAlignment
  </code></pre>
  
  <p>But i see on <kbd>Ctrl</kbd> + <kbd>Space</kbd> that the method exists, so i cant understand what is happening.</p>
  
  <p>A second try was, to set my <code>TextView</code> property to the property that comes from my <code>TextView</code>:</p>
  
  <pre><code>this.myTextView.setTextAlignment(MyTextView.getTextAlignment());
  </code></pre>
  
  <p>With no success, too.</p>
  
  <h2><strong>Obs: i do not want a Android XML Layout solution, i want a solution on code, because i generate the <code>TextView</code> dinamically on the <code>Activity</code></strong></h2>
  
  <h1><strong>I'm using API Level 15</strong></h1>
  
  <p>Any help?</p>