Set bind view in simple adapter?
<p>I want to setup view binder in simple adapter to show photos from contacts, however I set two text view's with name and number with Hash Map, so third value is Image View where I want to put contact photo corresponding to contact ID.
Thank you in advance, Wolf.</p>

<p>Here is my code : </p>

<pre><code>ArrayList&lt;HashMap&lt;String, String&gt;&gt; mapa = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();

            ContentResolver cr = getContentResolver();
            Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);

            if(cur.getCount() &gt; 0){
                while(cur.moveToNext()){
                    id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
                    String photoUri = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.PHOTO_ID));

                    if(Integer.parseInt(cur.getString(cur.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0){

                        final Cursor numCur = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "  = ?", new String[]{id}, null);


                        for(numCur.moveToFirst(); !numCur.isAfterLast(); numCur.moveToNext()){

                            brTel = numCur.getString(numCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                            ime = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));


                            tmpIme = new String[] {ime};


                            for(int i = 0; i &lt; tmpIme.length; i++){

                                HashMap&lt;String, String&gt; imeMapa = new HashMap&lt;String, String&gt;();
                                imeMapa.put("imeLista", ime);
                                imeMapa.put("checkBox", photoUri);
                                imeMapa.put("Mobilni", brTel);
                                mapa.add(imeMapa);

                            }

                        }
                        numCur.close();

                    }

                } // While
            }

            SimpleAdapter sa = new SimpleAdapter(getApplicationContext(), mapa, R.layout.imenik, new String[] {"imeLista", "checkBox", "Mobilni"}, new int[] {R.id.tvImeImenik, R.id.cbOznaci, R.id.tvSamoProba});
            sa.setViewBinder(simpleSlika);
            lImenik.setAdapter(sa);
</code></pre>

<p>and my view binder is :</p>

<pre><code>private final SimpleAdapter.ViewBinder simpleSlika = new SimpleAdapter.ViewBinder() {

            public boolean setViewValue(View view, Object data,
                    String textRepresentation) {

                if (view instanceof ImageView &amp;&amp; data instanceof Bitmap) {
                    ImageView v = (ImageView)view;
                    v.setImageBitmap((Bitmap)data);
                    // return true to signal that bind was successful
                    return true;
                }
                return false;

            }
        };
</code></pre>

<p>but it's not working.
Help please???</p>
