title: I want to change the text Color in android studio
body: <p>I had a problem I didn't know how to change colors in Java<br>
  I want to change the text color At the end of the code
    in the Calculation result The app is an application that tries to calculate body mass(bmi) 
  I don't know what codes to use to change the color of writing
   this is my java code and xml code can I get help plz </p>
  
  <p>java code </p>
  
  <pre><code>package com.example.bmicalculator;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.text.TextUtils;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.TextView;
  
  
  //Main activity class start here
  public class MainActivity extends Activity {
  
      //Define layout
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
  // Get the references to the widgets
          final EditText e1 = (EditText) findViewById(R.id.et1);
          final EditText e2 = (EditText) findViewById(R.id.et2);
          final TextView tv4 = (TextView) findViewById(R.id.tv4);
  
          findViewById(R.id.ib1).setOnClickListener(new View.OnClickListener() {
  
              // Logic for validation, input can't be empty
              @Override
              public void onClick(View v) {
  
                  String str1 = e1.getText().toString();
                  String str2 = e2.getText().toString();
  
                  if(TextUtils.isEmpty(str1)){
                      e1.setError("Please enter your weight");
                      e1.requestFocus();
                      return;
                  }
  
                  if(TextUtils.isEmpty(str2)){
                      e2.setError("Please enter your height");
                      e2.requestFocus();
                      return;
                  }
  
  //Get the user values from the widget reference
                  float weight = Float.parseFloat(str1);
                  float height = Float.parseFloat(str2)/1;
  
  //Calculate BMI value
                  float bmiValue = calculateBMI(weight, height);
  
  //Define the meaning of the bmi value
                  String bmiInterpretation = interpretBMI(bmiValue);
  
                  tv4.setText(String.valueOf(bmiValue + "-" + bmiInterpretation));
  
              }
          });
  
      }
  
      //Calculate BMI
      private float calculateBMI (float weight, float height)
      {
          return (float) (weight / (height * height));
      }
  
      // her I want change color
      private String interpretBMI(float bmiValue)
      {
  
          if (bmiValue &lt; 16) {
              return "Severely underweight" ;
  
  
          } else if (bmiValue &lt; 18.5) {
  
              return "Underweight" ;
          } else if (bmiValue &lt; 25) {
  
              return "Normal";
          } else if (bmiValue &lt; 30) {
  
              return "Overweight";
          } else {
              return "Obese";
          }
      }
  
      }
  </code></pre>
  
  <p>xml code </p>
  
  <pre><code>&lt;!-- Linear layout start here --&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/activity_main"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:background="@drawable/pic"
      tools:context=".MainActivity"&gt;
      &lt;!-- Text view for BMI Text --&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:layout_width="match_parent"
          android:layout_height="187dp"&gt;
  
          &lt;TextView
              android:id="@+id/tv1"
              android:layout_width="305dp"
              android:layout_height="93dp"
              android:layout_gravity="center"
              android:layout_marginStart="53dp"
              android:layout_marginLeft="53dp"
              android:layout_marginEnd="53dp"
              android:layout_marginRight="53dp"
              android:layout_marginBottom="30dp"
              android:fontFamily="@font/sss"
              android:paddingLeft="15dp"
              android:paddingTop="40dp"
              android:shadowColor="@android:color/black"
              android:shadowDx="4"
              android:shadowDy="4"
              android:text="1_MAC_Community"
              android:textAppearance="?android:attr/textAppearanceLarge"
              android:textColor="@android:color/white"
              android:textSize="25sp"
              android:typeface="serif"
              app:layout_constraintBottom_toTopOf="@+id/textView"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent"
              tools:ignore="MissingConstraints" /&gt;
  
          &lt;TextView
              android:id="@+id/textView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginStart="64dp"
              android:layout_marginLeft="64dp"
              android:layout_marginTop="30dp"
              android:layout_marginEnd="33dp"
              android:layout_marginRight="33dp"
              android:text="plz Fill YOUR  information"
              android:textAppearance="?android:attr/textAppearanceLarge"
              android:textColor="@android:color/white"
              android:textSize="25sp"
              android:typeface="serif"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/tv1"
              tools:ignore="MissingConstraints" /&gt;
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;TextView
          android:id="@+id/tv9"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:paddingTop="30dp"
          android:text="WEIGHT (KG)"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="@android:color/white"
          android:textStyle="bold|italic"
          android:typeface="serif" /&gt;
  
      &lt;!-- Edit text for entering weight with hint in kgs --&gt;
      &lt;EditText
          android:id="@+id/et1"
          android:layout_width="314dp"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:ems="10"
          android:fadingEdgeLength="10dp"
          android:hint="IN KGs"
          android:inputType="numberDecimal"
          android:scrollbarTrackHorizontal="@android:color/background_dark"
          android:textAlignment="center"
          android:textColorHighlight="#000000"
          android:textColorLink="#00FFFFFF"
          android:textCursorDrawable="@android:color/background_dark"&gt;
  
          &lt;requestFocus /&gt;
      &lt;/EditText&gt;
  
      &lt;!-- Text view for HEIGHT(CM)text --&gt;
      &lt;TextView
          android:id="@+id/tv3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:paddingTop="30dp"
          android:text="HEIGHT (Meter)"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="@android:color/white"
          android:textStyle="bold|italic"
          android:typeface="serif" /&gt;
  
      &lt;!-- Edit text for entering height with hint in cm --&gt;
      &lt;EditText
          android:id="@+id/et2"
          android:layout_width="281dp"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:ems="10"
          android:hint="IN Meter"
          android:textAlignment="center"
          android:inputType="numberDecimal"&gt;&lt;/EditText&gt;
  
      &lt;!-- Button for calculating the formula, when pressed, with calculate written over it --&gt;
      &lt;Button
          android:id="@+id/ib1"
          android:layout_width="158dp"
          android:layout_height="51dp"
          android:layout_gravity="center"
          android:layout_marginTop="20dp"
          android:fadingEdge="vertical"
          android:longClickable="true"
          android:nextFocusRight="@color/colorPrimaryDark"
          android:text="Calculate MY BMI"
          android:visibility="visible" /&gt;
  
      &lt;!-- Text view for showing result --&gt;
      &lt;TextView
          android:id="@+id/tv4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:paddingTop="20dp"
          android:text=""
          android:textSize="20dp"
          android:textStyle="bold"
          android:textColor="@android:color/holo_orange_dark"/&gt;
  
  &lt;/LinearLayout&gt;
      &lt;!-- Linear layout ends here --&gt;
  </code></pre>