I try to use LayoutInflater in a loop, but every time one of these guys is created, I need to change at least 2 TextViews found in each instance. What I now find at the moment matches and adds a bloated xml look just like I want, but the result is that only the first instatiaton resources change, and so it just gets overwritten many times.
LayoutInflater inflater; TextView eTitle; for(String[] episode : episodes) { //Log.d("Episodes", episode[0] + " / " + episode[2]); inflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.episode_list_item, listView); eTitle = (TextView) findViewById(R.id.episode_list_item_title); eTitle.setText(episode[2]); }
An example of the output of my list:
- 04 - Episode 04
- Episode title
- Episode title
- Episode title
where it should look like this:
- 01 - Episode 01
- 02 - Episode 02
- 03 - Episode 03
- 04 - Episode 04
what do i need to do to im get the corresponding unique text id from my bloated layouts?
source share