Android Open Source - demo-app-android Black List Adapter

From Project

Back to project page demo-app-android.


The source code is released under:

MIT License

If you think the Android project demo-app-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.rong.imkit.demo;
/*from  www  .ja va2s .c  o  m*/
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.List;

import io.rong.imlib.RongIMClient;

public class BlackListAdapter extends BaseAdapter {

  private LayoutInflater mLayoutInflater;
    private List<RongIMClient.UserInfo> mUserInfoList;

    public BlackListAdapter(Context context, List<RongIMClient.UserInfo> users) {
        mUserInfoList = users;
        mLayoutInflater = LayoutInflater.from(context);

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

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

  public long getItemId(int position) {
    return position;

  public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder = null;
    if (convertView == null || convertView.getTag() == null) {

      convertView = mLayoutInflater.inflate(R.layout.black_list_item,
          parent, false);
      viewHolder = new ViewHolder();
      viewHolder.itemName = (TextView) convertView

    } else {
      viewHolder = (ViewHolder) convertView.getTag();
    return convertView;

  static class ViewHolder {
    TextView itemName;


Java Source Code List