I have a LinearLayout with vertical orientation as parent, I want to add some view programmatically multiple times to this parent. Right now I am inflating the child every t
I'm not sure what your view is but have you creating it manually over inflating the XML:
ArrayList myList = getData();
for(String data : myList) {
LinearLayout layout = new LinearLayout(this);
layout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
TextView textView = new TextView(this);
textView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
textView.setText(data);
layout.addChild(textView);
parentPanel.addView(layout);
}
But yeah your clearly attempting something that has been done for you with Simple ListView & API