Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The common way of doing so is in the <code>getView</code> of your adapter. You could do something like this : </p> <pre><code>class ContactAdapter extends ArrayAdapter&lt;String&gt; { private LayoutInflater mInflater; public ContactAdapter(Context context, int textViewResourceId, List&lt;String&gt; items) { super(context, textViewResourceId, items); mInflater = LayoutInflater.from(context); } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.rowcontact, null); holder = new ViewHolder(); holder.lastname = (TextView) convertView.findViewById(R.id.rowTop); holder.firstname = (TextView) convertView.findViewById(R.id.rowBottom); holder.iconContact = (ImageView) convertView.findViewById(R.id.iconContact); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } String item = getItem(position); int i = (int) (Math.random() * 5 + 1); switch (i) { ... } if (item != null) { holder.lastname.setText(item.split("-")[0]); holder.firstname.setText(item.split("-")[1]); holder.iconContact.setImageBitmap(bm); } return convertView; } } static class ViewHolder { TextView lastname; TextView firstname; ImageView iconContact; } } </code></pre> <p>You can find full code example <a href="http://android-in-action.com/index.php?post/Droid-Contact-005%E2%80%93Set-up-and-customize-ListView-01" rel="nofollow">there</a>. With the holder example, you can set up your 4 views and update them.</p>
    singulars
    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