I have a xml in Android which is
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="122px"
android:layout_marginTop="40px"
android:id="@+id/am"
android:text="@string/iam"
android:textColor="#000000" android:textSize="20px">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginTop="40px"
android:id="@+id/jname"
android:textColor="#000000" android:textSize="20px" >
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/going"
android:text="@string/sloc"
android:textColor="#000000" android:textSize="20px">
</TextView>
My TextView jname will be dynamic i.e. I will be filling the spot with the data from JSON. What I want is that my TextView of the id jname should always come to the right of the TextView having source @string/iam and left of TextView having source @string/sloc. I don’t want to define layout_margin attributes because that would fix the positions and everything will overlap if the width of the dynamic data is not proper. Help!
If your problem is purely with layout, then just enclose all of that in a
LinearLayoutand set a weight for the middleTextView.