I have search many times and the only thing that I found is that You can't do it.
So I have to get alternatives like:
- Add then directly in the code. So you mess code and UI.
- Change
<merge>
element to other. So it's inefficient. - Use the index to get the view instead of the ID. Again you mess code and UI, but a little less than with first option.
In my case I have used the index letting me with code like:
inflater.inflate(R.layout.player_in_match, llPlayers, true);
// 4 Is because I have 4 elements in the R.layout.player_in_match
// and I wanna get the first of them.
TextView tvName = (TextView) llPlayers.getChildAt(llPlayers.getChildCount() - 4);
tvName.setText(name);