title: Android Custom TextView class -how to reuse it as a custom EditText view
body: <p>I have created a customTextView java class which looks like this more or less:</p>
  
  <pre><code>public class CustomTextView extends TextView {
  
  public CustomTextView(Context context, AttributeSet attrs) {
      super(context, attrs);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>in xml i'd use it like this:</p>
  
  <pre><code> &lt;com.mypackage.mystyles.CustomTextView
                      android:id="@+id/myid"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:text="hello world this is a tv" /&gt;
  </code></pre>
  
  <p>but i would also like to make a custom EditTextView with very similar overrided behavior and be able to make a call like this:</p>
  
  <pre><code>&lt;com.mypackage.mystyles.CustomEditText
                          android:id="@+id/et_id"
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:text="hello world this is a et" /&gt;
  </code></pre>
  
  <p>how can i use the same java class (CustomTextView.java in my case)  as i dont want to repeat code as really EditText is a subclass of TextView.  </p>