I have a format which will get repeated only the content of the image/the text inside it will change dynamically. This format will be added dynamically based on a web result
linear layout { linear layout { linear layout {image+text} linear layout {image+text} linear layout {image+text+image+text+image+text} } }
Create a layout which holds your format. and declare a layout that's going to hold your dynamic view. using Layout inflater you can add many view as you like.
LinearLayout ll = (LinearLayout) findViewById(R.id.parent);
for(int i=0;i<result.length();i++){
LayoutInflater inflater = (LayoutInflater) getSystemService( Context.LAYOUT_INFLATER_SERVICE );
View format = inflater.inflate(R.layout.format, null);
ll.addView(format);
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments