So, I want to create a custom Android TextView with a border INSIDE AN XML FILE, so not programmatically, and create 10 of those using a for-loop. Something like this:
LinearLayout layout = new LinearLayout(//something, //something);
TextView tv;
String[] data = //Certain data which I'm getting
for(int i = 0; i < data.length; i++) {
tv = (TextView) findViewById(R.id.tvTest);
layout.addView(tv);
}
But this doesn’t work for me for some reason. So to summarize:
- > Create custom TextView in XML (NOT PROGRAMMATICALLY with Java, but in XML)
- > Create an x amount of this particular TextView
- > Add it to the screen in Java
Can you help me with this?
This is code snippet
R.layout.detaillistitem is item u want to inflate.
_ListLayout is LinearLayout to which you can add above item.