Problem in Listview Custom adapter class
<p>I am explaining my issue straightaway. Please refer the following code snippet.</p>

<pre><code>@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;
}
</code></pre>

<p>I get null for tvAuthor . As a result, in the immediate next line where I try to setText, I get null pointer exception.</p>

<p>I have declared commentAuthor in the xml correctly. I cannot trace, from where this error pops up. Experts, kindly help.</p>

<p>ny help in this regard is well appreciated.</p>

<p>Look forward,
Regards,
Rony</p>
