if you are thinking of passing values ββto a layout, you want these values ββto appear in a layout element, such as Textview.
Suppose you have a TextView inside your layout.
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF" > <TextView android:id="@+id/myTextView" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>
then you can set the string value in TextView
String myText = "James"; TextView myTextView= (TextView) findViewById(R.id.myTextView); myTextView.setText(myText);
source share