Note that there are some explanatory texts on larger screens.

plurals
  1. POList view customization issue while scrolling
    text
    copied!<p>I have the below code which overrides the getView, What i want is always the first row should show some custom view and the item cell below this first will show regular cells. My code works fine without any errors, but when i scroll the first cell get repeat after continuos use of scroll upside down, Please refer the code below, If any one can answer this it be of great help. Thanks </p> <pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; int type = getItemViewType(position); holder = new ViewHolder(); System.out.println("getView " + position + " " + convertView + " type = " + type); if (convertView == null &amp;&amp; position !=0) { System.out.println("inside if " + position); //holder = new ViewHolder(); switch (type) { case TYPE_ITEM: convertView = mInflater.inflate(R.layout.item1, null); holder.textView = (TextView)convertView.findViewById(R.id.text); holder.textView.setText(mData.get(position)); break; case TYPE_SEPARATOR: convertView = mInflater.inflate(R.layout.item2, null); holder.textView = (TextView)convertView.findViewById(R.id.textSeparator); holder.textView.setText(mData.get(position)); break; } convertView.setTag(holder); }else if(position == 0){ System.out.println("inside else if " + position); convertView = mInflater.inflate(R.layout.header, null); holder.textView = (TextView)convertView.findViewById(R.id.text); }else { System.out.println("inside else " + position); holder = (ViewHolder)convertView.getTag(); try{ holder.textView.setText(mData.get(position)); }catch(Exception ex){ System.out.println("caught exception is "+ ex.getMessage()); } } return convertView; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload