title: TypedValue Converting to String
body: <p>At random points while I'm using my Android application, LogCat is flooded with dozens of repetitions of the following 5 lines:</p>
  
  <pre class="lang-none prettyprint-override"><code>10-26 12:53:30.372  21270-21270 W/Resources﹕ Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f0b00d8}
  10-26 12:53:30.372  21270-21270 W/Resources﹕ Converting to string: TypedValue{t=0x1d/d=0xffe51c23 a=2 r=0x7f090047}
  10-26 12:53:30.374  21270-21270 W/Resources﹕ Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f0b008a}
  10-26 12:53:30.375  21270-21270 W/Resources﹕ Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f0b00d6}
  10-26 12:53:30.375  21270-21270 W/Resources﹕ Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f0b00d7}
  </code></pre>
  
  <p>Using the information from the accepted answer to <a href="https://stackoverflow.com/questions/5554876/how-to-identify-where-code-is-incorrect-if-i-get-warning-converting-to-string">this question</a>, I determined that it is trying to interpret nulls (0x0) as booleans (0x12), which makes no sense, as I'm never dealing with either nulls or booleans. </p>
  
  <p>The resource IDs from the logs (r=0x?) point to views/view attributes within one of two layouts, which I'll include below. </p>
  
  <p>The only places in my code where I reference those resource IDs are a) the CursorAdapter that uses the first layout, and b) a class that uses the second layout and I will include that code below as well. </p>
  
  <p>I'm not sure if this is something to worry about. I know correlation does not imply causation, but when LogCat is flooded with those logs, scrolling through my app is noticeably janky. </p>
  
  <p>Any help with figuring out what is going on would be appreciated.</p>
  
  <p>Layout file #1:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:minHeight="72dp"
      android:padding="16dp"&gt;
  
      &lt;TextView
          android:id="@+id/event_name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:ellipsize="end"
          android:maxLines="1"
          android:text="Title"
          android:textSize="16sp"
          android:textColor="@color/primary_text_color"/&gt;
  
      &lt;TextView
          android:id="@+id/event_dates"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_below="@id/event_name"
          android:text="Dates"
          android:textColor="@color/secondary_text_color"
          android:textSize="14sp" /&gt;
  
      &lt;TextView
          android:id="@+id/event_location"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@id/event_name"
          android:layout_toLeftOf="@id/event_dates"
          android:ellipsize="end"
          android:singleLine="true"
          android:text="Location"
          android:textColor="@color/secondary_text_color"
          android:textSize="14sp" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Layout file #2:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;TextView
          android:id="@+id/event_type"
          android:textSize="14sp"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:background="@color/primary"
          android:paddingLeft="16dp"
          android:paddingTop="8dp"
          android:paddingBottom="8dp"
          android:text="Header"
          android:textColor="#FFFFFF" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>CursorAdapter:</p>
  
  <pre><code>public class EventCursorAdapter extends CursorAdapter {
  
      public String getKey(int position) {
          Cursor c = getCursor();
          c.moveToPosition(position);
          return c.getString(c.getColumnIndex(Database.Events.KEY));
      }
  
      public EventCursorAdapter(Context context, Cursor c, int flags) {
          super(context, c, flags);
      }
  
      @Override
      public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
          LayoutInflater inflater = LayoutInflater.from(context);
          return inflater.inflate(R.layout.list_item_event, viewGroup, false);
      }
  
      @Override
      public void bindView(View view, Context context, Cursor cursor) {
          TextView dates = (TextView) view.findViewById(R.id.event_dates);
          Date startDate = null, endDate = null;
          Log.d(Constants.LOG_TAG, "Start: " + cursor.getString(cursor.getColumnIndex(Database.Events.START)));
          try {
              startDate = new Date(cursor.getLong(cursor.getColumnIndex(Database.Events.START)));
              endDate = new Date(cursor.getLong(cursor.getColumnIndex(Database.Events.END)));
          } catch (Exception e) {
              // Oops.
          }
          dates.setText(EventHelper.getDateString(startDate, endDate));
  
          TextView name = (TextView) view.findViewById(R.id.event_name);
          name.setText(cursor.getString(cursor.getColumnIndex(Database.Events.NAME)));
  
          TextView location = (TextView) view.findViewById(R.id.event_location);
          location.setText(cursor.getString(cursor.getColumnIndex(Database.Events.LOCATION)));
      }
  }
  </code></pre>
  
  <p>Other class:</p>
  
  <pre><code>public class EventTypeHeader extends ListHeader {
  
      public EventTypeHeader(String title) {
          super(title);
      }
  
      @Override
      public View getView(Context c, LayoutInflater inflater, View convertView) {
          ViewHolder holder;
          if (convertView == null || !(convertView.getTag() instanceof ViewHolder)) {
              convertView = inflater.inflate(R.layout.list_item_event_type_header, null);
              holder = new ViewHolder();
              holder.text = (TextView) convertView.findViewById(R.id.event_type);
              convertView.setTag(holder);
          } else {
              holder = (ViewHolder) convertView.getTag();
          }
  
          holder.text.setText(getText());
  
          return convertView;
      }
  
      private static class ViewHolder {
          TextView text;
      }
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'll include what each resource ID references in my layout file</p>
  
  <p>0x7f0b00d8: <code>event_type</code></p>
  
  <p>0xffe51c23: <code>primary</code> (my app's primary color)</p>
  
  <p>0x7f0b008a: <code>event_name</code></p>
  
  <p>0x7f0b00d6: <code>event_dates</code></p>
  
  <p>0x7f0b00d7: <code>event_location</code></p>
  
  <p>Also, note that this is running on the 5.0 Preview. However, I still saw these logs back when I was on 4.4.4.</p>
  
  <p><strong>EDIT #2</strong></p>
  
  <p>After searching through the Android source code, I've discovered that the only place that "Converting to String" exists is in the class <code>android.content.res.TypedArray</code>. </p>
  
  <p>However, I never even instantiate, import, or in any way use that class in my project! This just gets weirder and weirder.</p>
  
  <p><strong>EDIT #3</strong></p>
  
  <p>Per the request of a commenter, I have uploaded my <code>styles.xml</code> and <code>colors.xml</code> to a gist, which can be found <a href="https://gist.github.com/nwalters512/23f265e94935ffba67f4" rel="nofollow noreferrer">here</a>.</p>