Hi experts, I am explaining my issue straightaway. Please refer the following code snippet.
@Override
public View getView(int index, View convertView, ViewGroup parent) {
Comments comment = comments.get(index);
if (convertView == null) {
LayoutInflater inflator = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflator.inflate(R.layout.comment_row, null);
}
TextView tvAuthor = (TextView) convertView.findViewById(R.id.commentAuthor);
System.out.println("tvAuthor"+tvAuthor);
tvAuthor.setText(comment.getAuthor());
convertView.setTag(comment);
return convertView;
}
I get null for tvAuthor . As a result, in the immediate next line where I try to setText, I get null pointer exception.
I have declared commentAuthor in the xml correctly. I cannot trace, from where this error pops up. Experts, kindly help.
ny help in this regard is well appreciated.
Look forward, Regards, Rony