Andrei Terecoasa
Andrei Terecoasa

Reputation: 572

android.view.InflateException: Binary XML file line #13: Error inflating class android.widget.TextView

First of all i know there are a lot of answered questions (like mine) out there but i simply can't find the right solution for me.

The error apears when starting the android app on phone. Note that on emulator works like a charm! :)

XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
    >

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:orientation="horizontal">
    <TextView
            android:id="@+id/tvDepartament"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/dept_text"
            android:padding="20dp"/>
    <Spinner
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/dptSelect"
            android:spinnerMode="dropdown"
            android:clickable="true"/>
</LinearLayout>

<ListView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/contactsList"
        android:layout_gravity="center_horizontal"/>


</LinearLayout>

Now, the erorr log: http://pastebin.com/LNWauPyC

Colours: http://pastebin.com/4SdHCgEq

Upvotes: 0

Views: 838

Answers (2)

Andrei Terecoasa
Andrei Terecoasa

Reputation: 572

I actually get it! The problem was with the custom theme i was trying to use. I think the main reason for that error came from trying to extend Material Light and that was incompatible with android version on my phone! :) If someone can confirm that i'll be gratefull!

Upvotes: 0

voodoo98
voodoo98

Reputation: 175

The problem is

  • Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2 at android.content.res.TypedArray.getColor(TypedArray.java:326)

The code or id of the color is invalid.

Upvotes: 1

Related Questions