title: Why does applying a theme to an activity cause the following crash?
body: <p>I've a typical scenario - master (ListFragment) activity which fires up a detail activity on item click. All working fine.</p>
  
  <p>Now I wanted to make all the text in the detail view (red/green) based on a programmatic condition. I understand the way to do this is with a theme</p>
  
  <p>So in values-v14 (my Samsung Note 1 Device is running android 4.1), 
  styles.xml</p>
  
  <pre><code>&lt;style name="ExpensesStyle" parent="@android:style/TextAppearance.Medium"&gt;
          &lt;item name="android:textColor"&gt;@color/expense_background&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>colors.xml</p>
  
  <pre><code>&lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;color name="credit_background"&gt;#6DA000&lt;/color&gt;
      &lt;color name="expense_background"&gt;#D30A0A&lt;/color&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>androidManifest.xml</p>
  
  <pre><code>&lt;activity
          android:name="com.app.transactions.TransactionActivity"
          android:label="@string/app_name" 
          android:theme="@style/ExpensesStyle"&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>The android:theme attribute causes the following crash. Applying the style to an individual View (EditText) works correctly.</p>
  
  <pre><code>W/ResourceType(30089): Too many attribute references, stopped at: 0x01010099
  W/ResourceType(30089): Too many attribute references, stopped at: 0x0101009a
  W/ResourceType(30089): Too many attribute references, stopped at: 0x0101009b
  E/com.app.TranAct(30089): Error in creation Tran Detail Activity
  E/com.app.TranAct(30089): android.view.InflateException: Binary XML file line #30: Error inflating class &lt;unknown&gt;
  E/com.app.TranAct(30089):   at android.view.LayoutInflater.createView(LayoutInflater.java:619)
  E/com.app.TranAct(30089):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693)
  E/com.app.TranAct(30089):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
  E/com.app.TranAct(30089):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
  E/com.app.TranAct(30089):   at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
  E/com.app.TranAct(30089):   at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
  E/com.app.TranAct(30089):   at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
  E/com.app.TranAct(30089):   at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3163)
  E/com.app.TranAct(30089):   at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3223)
  E/com.app.TranAct(30089):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:312)
  E/com.app.TranAct(30089):   at android.app.Activity.setContentView(Activity.java:1924)
  E/com.app.TranAct(30089):   at com.app.transactions.TransactionActivity.onCreate(TransactionActivity.java:30)
  </code></pre>
  
  <p>Activity.onCreate</p>
  
  <pre><code>@Override
      protected void onCreate(Bundle instanceState) {
          try {
              super.onCreate(instanceState);
              setContentView(R.layout.activity_simple);
  
              Intent intent = getIntent();
              long transId  = intent.getLongExtra(EXTRA_TRAN_ID, 0);
              boolean isExpense = intent.getBooleanExtra(EXTRA_TRAN_IS_EXPENSE, true);
  
              if(instanceState != null)
                  return;
  
              Fragment frag = TransactionDetailFragment.newInstance(isExpense ? new ExpenseFragment(): new CreditFragment(),
                                                                  transId, this);
              getSupportFragmentManager().beginTransaction()
                                          .add(R.id.simple_fragment_container, frag)
                                          .commit();
          } catch (Exception e) {
              Log.e(TAG, "Error in creation Tran Detail Activity", e);
          }
  
      }
  </code></pre>
  
  <p>layout.activity_simple is a simple framelayout with a placeholder for a fragment.</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/simple_fragment_container" /&gt;
  </code></pre>
  
  <p>Line 30 of the fragment layout contains </p>
  
  <pre><code>&lt;TextView
      style="?android:listSeparatorTextViewStyle"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="@string/label_category" /&gt;
  </code></pre>