0

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

Andrei Terecoasa
  • 561
  • 2
  • 7
  • 25
  • what device? What version of android is the device running? – Blackbelt Apr 13 '15 at 08:31
  • By looking at the log this seems related to an incorrect color attribute, probably in your theme or style: Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2. Please review your styles and post them for reference if you still need assistance. – JHH Apr 13 '15 at 08:32
  • I'm running on htc desire 500, developing with intellij IDEA! :) Android. 4.1.2 I've update main post with colours styles ! – Andrei Terecoasa Apr 13 '15 at 08:44

2 Answers2

1

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.

voodoo98
  • 175
  • 2
  • 4
0

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!

Andrei Terecoasa
  • 561
  • 2
  • 7
  • 25