I just want to add same child LinearLayout into Parent LinearLayout multiple times as per user requirements using for loop with same contents as child(i have added some TextView and ImageView to child LinearLayout);
public class ListData extends AppCompatActivity {
LinearLayout childLL,parentLL;
TextView tName,tEmail,tCity;
ImageView iImage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list_data);
parentLL=(LinearLayout) findViewById(R.id.parentList);
childLL=(LinearLayout) findViewById(R.id.childList);
tName=(TextView) findViewById(R.id.listName);
tEmail=(TextView) findViewById(R.id.listEmail);
tCity=(TextView) findViewById(R.id.listCity);
iImage=(ImageView) findViewById(R.id.listImage);
for(int i=0;i<10;i++) {
//parentLL.addView(childLL);
//please Suggest code
}
}
}
