同じレイアウトを複数追加するにはどうすればよいですか
View v = (LinearLayout) inflater.inflate(R.layout.tab_frag2_layout,container, false);
RelativeLayout tv = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
RelativeLayout tv2 = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
これを行うとエラーが発生し、これを行うと1回だけ表示されます
View v = (LinearLayout) inflater.inflate(R.layout.tab_frag2_layout,container, false);
RelativeLayout tv = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
RelativeLayout tv2 = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv2);
どうすればいいですか 助けてください