views:

41

answers:

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 ?

A: 

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

aioobe
thank u but1. 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