In my application I want show some text into TextView
, and I get this text from server.
I should use just one textView
in XML layout, and I should set color for this Texts.
My XML :
<TextView
android:id="@+id/rowExplore_userName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size3"
android:layout_marginTop="@dimen/padding8"
android:layout_toRightOf="@+id/rowExplore_imageCard"
android:fontFamily="sans-serif"
android:gravity="left|center_vertical"
android:text="Adam"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/font14" />
JSON :
"name": "Adam Sandel",
"info": "liked",
"movieName": "SpiderMan",
Java code :
rowExplore_userName.setText(response.getName() + response.getInfo() + response.getMovieName() );
I want set color dynamically such as below image :
How can I it? Please help me