Code example for View

Methods: findViewByIdsetTag

0
    public View getHeaderView(int position, View convertView, ViewGroup parent) {
        HeaderViewHolder holder;
        if (convertView == null) {
            convertView = mInflater.inflate(mHeaderResId, parent, false);
            holder = new HeaderViewHolder();
            holder.textView = (TextView) convertView.findViewById(android.R.id.text1);
            convertView.setTag(holder);
        } else { 
            holder = (HeaderViewHolder) convertView.getTag();
        } 
 
        T item = getItem(position);
        CharSequence string;
        if (item instanceof CharSequence) {
            string = (CharSequence) item;
        } else { 
            string = item.toString();
        } 
 
        // set header text as first char in string 
Experience pair programming with AI  Get Codota for Java