title: android:theme not working in layout file
body: <p>According to <a href="https://developer.android.com/training/material/theme.html#Inheritance">this</a>:</p>
  
  <blockquote>
    <p>Elements in XML layout definitions can specify the android:theme
    attribute, which references a theme resource. This attribute modifies
    the theme for the element and any child elements, which is useful for
    altering theme color palettes in a specific portion of an interface.</p>
  </blockquote>
  
  <p>Which means we can specify <code>android:theme</code> in layout files. And also if we look at the way <code>Toolbar</code> is used:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/green"
      android:minHeight="?attr/actionBarSize"
      app:theme="@style/ThemeOverlay.AppCompat.ActionBar" /&gt;
  </code></pre>
  
  <p>It is clear that <code>theme</code> support was added. </p>
  
  <p>Now I am trying this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="Test"
          android:theme="@style/TextViewTheme" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Where <code>TextViewTheme</code> is:</p>
  
  <pre><code>&lt;style name="TextViewTheme" parent="TextAppearance.AppCompat"&gt;
      &lt;item name="android:textColor"&gt;#ff0000&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>This seems to look perfectly in design editor but at runtime I am getting this exception:</p>
  
  <pre><code>12-05 15:56:40.414  32501-32501/com.my.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: com.my.app, PID: 32501
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.app/com.my.app.TabbedActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class android.widget.TextView
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
       Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class android.widget.TextView
              at android.view.LayoutInflater.createView(LayoutInflater.java:633)
              at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
              at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at com.my.app.ui.DrawerFragment.onCreateView(DrawerFragment.java:20)
              at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:920)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
              at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1206)
              at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2159)
              at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
              at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
              at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
              at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
              at com.my.app.TabbedActivity.onCreate(TabbedActivity.java:40)
              at android.app.Activity.performCreate(Activity.java:5933)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
       Caused by: java.lang.reflect.InvocationTargetException
              at java.lang.reflect.Constructor.newInstance(Native Method)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
              at android.view.LayoutInflater.createView(LayoutInflater.java:607)
              at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
              at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at com.my.app.ui.DrawerFragment.onCreateView(DrawerFragment.java:20)
              at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:920)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
              at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1206)
              at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2159)
              at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
              at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
              at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
              at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
              at com.my.app.TabbedActivity.onCreate(TabbedActivity.java:40)
              at android.app.Activity.performCreate(Activity.java:5933)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
       Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 24
              at android.content.res.TypedArray.getColor(TypedArray.java:401)
              at android.widget.TextView.&lt;init&gt;(TextView.java:692)
              at android.widget.TextView.&lt;init&gt;(TextView.java:629)
              at android.widget.TextView.&lt;init&gt;(TextView.java:625)
              at java.lang.reflect.Constructor.newInstance(Native Method)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
              at android.view.LayoutInflater.createView(LayoutInflater.java:607)
              at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
              at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at com.my.app.ui.DrawerFragment.onCreateView(DrawerFragment.java:20)
              at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:920)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
              at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1206)
              at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2159)
              at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
              at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547)
              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
              at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
              at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
              at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
              at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
              at com.my.app.TabbedActivity.onCreate(TabbedActivity.java:40)
              at android.app.Activity.performCreate(Activity.java:5933)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  </code></pre>
  
  <p>Moreover I looked through <a href="https://github.com/google/iosched/search?utf8=%E2%9C%93&amp;q=android%3Atheme">Google IO app source code</a> and couldn't find any <code>android:theme</code> inside layout files. Did I misunderstood something?</p>