1

can I genrate java code instead using xml code ? lets say i want to do this xml code in a loop :

<TableRow 
 android:id="@+id/LivingCreture"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content">
 <TextView android:text="LivingCreture" 
 android:gravity="left"
 android:id="@+id/LivingCretureT"
 android:layout_width="45dp"
 android:layout_height="45dp"></TextView>
 <EditText android:text=" "
 android:gravity="center"
 android:id="@+id/LivingCretureE" 
 android:layout_width="45dp"
 android:layout_height="45dp"></EditText>
<ImageView android:id="@+id/ImageView03" android:layout_width="wrap_content"android:layout_height="wrap_content"></ImageView>       

is it possiable ?

zed_0xff
  • 32,417
  • 7
  • 53
  • 72
yoav.str
  • 1,547
  • 6
  • 33
  • 73

1 Answers1

0

I believe your best option is to create a "template" tag (containing all elements you want to add in the loop) and include these elements using the <include> tag as many times you need.

Have a look at

Community
  • 1
  • 1
aioobe
  • 413,195
  • 112
  • 811
  • 826
  • thank u but 1. i find it difficult to work with when i want to work every time with another id on the same include meaning lets say i want two of this codes under uniqe name fro each one i didnt get how its possiable 2.can i decide in a complition that this sthing run constant number of times ? – yoav.str Jun 17 '10 at 08:25