Question

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">

Was it helpful?

Solution

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.

OTHER TIPS

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" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top