android listview showing nothing

  • Replies:1
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Apr 21, 2016 1:51:26 PM via Website

Listview Size is 10 items. Till it does not display anything in Listview.I am adding List of Item in above adapter but not able to get the Listview single row. Please help me to solve my error adapter.

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
import bughunters.tashfik.chooseapp.Model.Category;
import bughunters.tashfik.chooseapp.Model.Comment;
import bughunters.tashfik.chooseapp.R;
public class CommentViewAdapter extends BaseAdapter {

private Context context;

private List<Comment> messagesItems;

// public static List<String> imagelist;

public CommentViewAdapter(Context context, List<Comment> navDrawerItems) {
    Toast.makeText(context,"Sixe ids"+String.valueOf(navDrawerItems.size()),Toast.LENGTH_LONG).show();
    this.context = context;
    this.messagesItems = navDrawerItems;


public int getCount() {
    return messagesItems.size();

public Object getItem(int position) {
    return messagesItems.get(position);

public long getItemId(int position) {
    return position;

public View getView(int position, View convertView, ViewGroup parent) {

    LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);

    convertView = mInflater.inflate(R.layout.comments_list_item, null);

    TextView textViewProfileName = (TextView) convertView.findViewById(;
    TextView textViewMesssage = (TextView) convertView.findViewById(;
    TextView textViewTime = (TextView) convertView.findViewById(;
    ImageView imageViewUserProfilePic = (ImageView) convertView.findViewById(;


    return convertView;
  • Forum posts: 207

Apr 25, 2016 3:00:09 PM via Website


What it is returning. Print the log and check. May be it is returning 0. if this that check where you are adding the data in it.