title: Reusing 'inputType' attribute from TextView in custom view
body: <p>I'm trying to reuse the 'android:inputType' attribute from TextView in my custom view, but the error I get is:</p>
  
  <blockquote>
    <p>String types not allowed (at 'inputType' with value 'textMultiline').</p>
  </blockquote>
  
  <p>I have referred to the solution at <a href="https://stackoverflow.com/a/10361617/313042">https://stackoverflow.com/a/10361617/313042</a></p>
  
  <p>The attr file contains:</p>
  
  <pre><code>&lt;declare-styleable name="MyEditText"&gt;
      &lt;attr name="android:inputType"/&gt;
  &lt;/declare-styleable&gt;
  </code></pre>
  
  <p>The MyEditText.java is:</p>
  
  <pre><code>int n = typedArray.getIndexCount();
  for (int i = 0; i &lt; n; i++) {
      int attr = typedArray.getIndex(i);
  
      switch (attr) {
          case R.styleable.MyEditText_android_inputType:
              inputTypes = typedArray.getInt(attr, EditorInfo.TYPE_NULL);
              break;
  
      }
  }
  </code></pre>
  
  <p>and the layout file contains:</p>
  
  <pre><code>&lt;com.example.MyEditText
    android:id="@+id/met"
    style="@style/MyStyle"
    android:layout_marginLeft="0dp"
    android:layout_marginRight="0dp"
    android:layout_marginTop="12dp"
    android:inputType="textMultiline" /&gt;
  </code></pre>
  
  <p>Is there any way I can solve this issue? Thanks.</p>