Note that there are some explanatory texts on larger screens.

plurals
  1. POlistadapter getview function
    primarykey
    data
    text
    <p>the problem is happend when I add setContentView in my ListActivity. here is my oncreate function:</p> <pre><code> @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mAdapter = new MyCustomAdapter(); for (int i = 1; i &lt; 10; i++) { mAdapter.addItem("item " + i); } setListAdapter(mAdapter); // setContentView(R.layout.main); } </code></pre> <p>and here is my adapter getview function :</p> <pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; int type = getItemViewType(position); System.out.println("getView " + position + " " + convertView + " type = " + type); if (convertView == null) { holder = new ViewHolder(); switch (type) { case TYPE_ITEM: convertView = mInflater.inflate(R.layout.item1, null); holder.textView = (TextView)convertView.findViewById(R.id.text); break; case TYPE_SEPARATOR: convertView = mInflater.inflate(R.layout.item2, null); holder.textView = (TextView)convertView.findViewById(R.id.textSeparator); break; } convertView.setTag(holder); } else { holder = (ViewHolder)convertView.getTag(); } holder.textView.setText(mData.get(position)); return convertView; } } </code></pre> <p>when i running the code I can see message in logcat : <img src="https://i.stack.imgur.com/Q9tAM.jpg" alt="enter image description here"></p> <p>it's i expected .but the problem comes when add SetContent(View) code in oncreate() function .the logcat message follow this: <img src="https://i.stack.imgur.com/KaOYQ.jpg" alt="enter image description here"></p> <p>the problem cause picture shows in error postion first when i want download img from web in thread and bind it on listItem . the first item will show all picture quickly then change as the first item's picture and ohter item show thier picture. but when i remove the setcontentview code from oncreate the problem is gone.. need help </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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