Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource id cannot be an empty string (at 'text' with value '?') in textAppearance attribute

I have the following two textViews in my layout:

<TextView
    android:id="@+id/TextView_playSourceWord"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/TextView_playTheme"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:layout_margin="@dimen/word_box_margin"
    android:text="Maison" />

<TextView
    android:id="@+id/TextView_playTargetWord"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/TextView_playSourceWord"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:layout_margin="@dimen/word_box_margin"
    android:text="?" />

I don't have any error for the first one, but in the second one android:textAppearance="?android:attr/textAppearanceLarge" is generating the following error:

error: Error: Resource id cannot be an empty string (at 'text' with value '?').

I also have other TextViews in other layouts with the same value for textAppearance and there are no errors there. Is there a way to fix this without having to re-create the style manually?

like image 316
PrincessLilly Avatar asked Apr 05 '14 16:04

PrincessLilly


1 Answers

You have to escape ? as coded below

android:text="\?"
like image 142
Faisal Ali Avatar answered Oct 19 '22 11:10

Faisal Ali