Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Android - can i add EditText value to the android:text row of a TextView in activity_main and have it concatenate?

$
0
0
<EditText    android:id="@+id/et_name"    android:layout_width="match_parent"    android:layout_height="48dp"    android:layout_margin="20dp"    android:hint="@string/str_name" /><TextView    android:id="@+id/tvSentence"    android:layout_width="match_parent"    android:layout_height="48dp"    android:text="@string/str_hello1"/>

I want et_name to be added to the @string/str_hello1 line. I tried this:

<TextView    android:layout_width="match_parent"    android:layout_height="48dp"    android:text="@string/str_hello1"  +"@+id/et_name"

and

    android:text="@string/str_hello1"  + et_name

and

    android:text="@string/str_hello1"  +"et_name"

But none of them worked and now everything is underlined in red saying unexpected text.


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>