title: Reading Android attributes on my custom view
body: <p>I have created a custom layout class (extends RelativeLayout) and have a TextView as part of the layout.</p>
  
  <p>I want to apply the properties declared in XML to my TextView, is there anyway I can read the android attributes (not my custom attributes, that part is already taken care of). </p>
  
  <p>For example in my XML I'll have this:</p>
  
  <pre><code>&lt;my.custom.MyLayout
      android:layout_width="100dp"
      android:layout_height="20dp"
      android:text="SomeText" /&gt; 
  </code></pre>
  
  <p>I want to read the text attribute and apply it to my TextView (currently it is being applied to the RelativeLayout) instead of creating my own attribute and reading it.</p>
  
  <p>My custom layout is something like this :</p>
  
  <pre><code>public class MyLayout extends RelativeLayout {
  
      private TextView textView;
      public void MyLayout(final Context context, final AttributeSet attrs) {
          /**Read android attributes and apply it to TextView **/
          ??
      }
  </code></pre>
  
  <p>My current solution is creating custom attributes and reading them, but I feel that is not a good solution as I'll be duplicating every attribute declared to TextView.</p>
  
  <p>More info about my current solution.</p>
  
  <p>I have a custom attribute called myText which I use to apply the text declared in XML to my TextView.</p>
  
  <p>In my layout XML :</p>
  
  <pre><code>myNameSpace:myText="SomeText"
  </code></pre>
  
  <p>And read it in my Java class :</p>
  
  <pre><code>String text= a.getString(R.styleable.MyStyleable_myText);
  textView.setText(text);
  </code></pre>
  
  <p>I'm looking to get rid of my custom attributes and read "android:" attributes.</p>