I'm trying to use LayoutInflater in a loop, but each time one of these guys is instantiated, I need to modify at least 2 TextViews found within each instantiation. What i currently have at the moment instantates appropriately and adds the inflated xml view just like I want it to, but the result is that only the first instatiaton's resources are getting modified, and therefore 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]);
}
Example output of my list:
where its supposed to look like this:
what do i need to do to ensure that im getting the corresponding unique textview id's from my inflated layouts?
Why don't you use ListView instead?
LayoutInflater inflater = inflater = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
for(String[] episode : episodes) {
View view = inflater.inflate(R.layout.episode_list_item, null);
mTitle = (TextView) view.findViewById(R.id.episode_list_item_title);
mTitle.setText(episode[2]);
listView.addView(view);
}