Pregunta

While creating a textview as posted below, eclipse underscored some properties of this textview with red squiggle, and the hint label said ....requires level API 14.

how can i know my current API level? and how to upgrade it?

xml_Code:

<TextView
           android:id="@+id/latLabel"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:layout_alignParentTop="true"
           android:gravity="left"
           android:text="@string/latLabel"
           android:textSize="@dimen/dividerTitleSize"
           android:textColor="@android:color/holo_red_dark">

¿Fue útil?

Solución

Check in your Manifest file.

You should have a line similar to:

<uses-sdk
        android:minSdkVersion="10" <--Set to 14 if you want to require API 14
        android:targetSdkVersion="17" />

If you don't make sure to add it.

Otros consejos

You will need to change your current API level in your Android manifest to 14 or above. If you want to keep your API level lower than 14 and use the color red, add a "color.xml" file in your res/values folder, then in that XML file, put the following code: <color name="red">#ffff0000</color>

Then you can use android:textColor="@color/red"

Go to the Manifest file in your project and check

 <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top