I have a TextView in my application. Based on the value I get from server, I want to set the text color of the TextView.
This is my textview
<TextView
android:id="@+id/approval_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:text="W" />
- if P I have to set Orange
- if A I have to set green
- if R I have to set red
How I can do this?