I'm trying to color a word (house) as long as user types "house" in the edittext. This is what I've done:
if (textA.getText().toString().equals("house")){
String name = String.valueOf(textA.getText().toString().equals("house"));
name.setTextColor(Color.parseColor("#bdbdbd"));
}
my xml is as follows
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginEnd="15dp"
android:orientation="vertical"
android:padding="5dp">
<EditText
android:id="@+id/textA"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:inputType="textMultiLine"
android:maxLines ="4"
android:maxLength ="2000"
android:textColorHint="@color/grey"
android:background="@android:color/transparent"
android:gravity="top"/>
</LinearLayout>
however this causes the app to crash. Dont know what it is I'm doing wrong. I'm new to android. Any advice please?
name.setTextColoras name is string(local var)