ダイナミックにテキストビューを追加したいのですが、私は以下のコードを追加しました。私は自分のアクティビティにtextviewは表示されません。私はすでにリサイクルビューを使っているので、リストビューを追加することはできません。いずれかのエラーがありますか?androidに動的なtextViewを追加できません
{
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout review_layout = (LinearLayout) rootMovieView.findViewById(R.id.review_comment);
for (ReviewsResult comment : review.getReviewsResults()) {
View view = layoutInflater.inflate(R.layout.layout_movie_comments, review_layout, false);
TextView tvCommentBy = (TextView) view.findViewById(R.id.tv_comment_by);
TextView tvCommentContent = (TextView) view.findViewById(R.id.tv_comment_content);
tvCommentContent.setText(comment.getContent());
tvCommentBy.setText(comment.getAuthor());
review_layout.addView(view);
}
}
アクティビティ – Konstantin