I want to concat two text and display with single TextView in Android. I have tried following type. It displays in logcat only, but it isn’t concat in XML textview.
Here is my code:
<TextView
android:id="@+id/heizgriffe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Heizgriffe"
android:textColor="#000"
android:textSize="12dp"
android:textStyle="bold"
android:layout_below="@+id/txt"/>
in Java class:
txtConcat = (TextView)findViewById(R.id.txt);
String hub="Hubraum:";
String str= ItemList.getTxt(); // fetting from webservice
txtConcat .setText(hub + str );
Anything wrong here?
1 Answer