Android: loading the device contact images not working,BufferedInputStream is closed error
<p>Hi iam trying to load the my phone contacts with images into a list for this iam using <a href="https://github.com/nostra13/Android-Universal-Image-Loader" rel="nofollow">UniversalImageLoader</a> from git hub</p>

<p>but i ran into few error which iam unable to solve </p>

<pre><code>12-20 12:53:42.403: W/System.err(3407): java.io.IOException: BufferedInputStream is closed
12-20 12:53:42.403: W/System.err(3407):     at java.io.BufferedInputStream.streamClosed(BufferedInputStream.java:118)
12-20 12:53:42.403: W/System.err(3407):     at java.io.BufferedInputStream.read(BufferedInputStream.java:279)
12-20 12:53:42.403: W/System.err(3407):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
12-20 12:53:42.403: W/System.err(3407):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:493)
12-20 12:53:42.403: W/System.err(3407):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:549)
12-20 12:53:42.403: W/System.err(3407):     at org.app.myneigh.activity.ProfileActivity$asynGetContacts.doInBackground(ProfileActivity.java:94)
12-20 12:53:42.403: W/System.err(3407):     at org.app.myneig.activity.ProfileActivity$asynGetContacts.doInBackground(ProfileActivity.java:1)
12-20 12:53:42.403: W/System.err(3407):     at android.os.AsyncTask$2.call(AsyncTask.java:252)
</code></pre>

<p>below is my asynctask from UniIMgLOader</p>

<pre><code>protected class asynGetContacts extends AsyncTask&lt;String, Void, Integer&gt; {      
        protected Integer doInBackground(String... params) {
            try {
                ImageListActivity.this.runOnUiThread(new Runnable() {
                    public void run() {
                        dialog = ProgressDialog.show(ImageListActivity.this, "","Lütfen bekleyin...", true);
                        dialog.show();
                    }
                });
                Uri uri = ContactsContract.Contacts.CONTENT_URI;
                ContentResolver cr = getContentResolver();
                String sortOrder = ContactsContract.Contacts.DISPLAY_NAME
                        + " COLLATE LOCALIZED ASC";
                Cursor cur = cr.query(uri, null, null, null, sortOrder);
                if (cur.getCount() &gt; 0) {
                    String id;
                    String name;
                    while (cur.moveToNext()) {
                        Contact c = new Contact();
                        id = cur.getString(cur
                                .getColumnIndex(ContactsContract.Contacts._ID));
                        name = cur
                                .getString(cur
                                        .getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
                        Uri my_contact_Uri = Uri.withAppendedPath(
                                ContactsContract.Contacts.CONTENT_URI,
                                String.valueOf(id));

                        InputStream inputStream = ContactsContract.Contacts
                                .openContactPhotoInputStream(getContentResolver(),
                                        my_contact_Uri);
                        BufferedInputStream buf = new BufferedInputStream(inputStream);
                        Bitmap my_btmp = BitmapFactory.decodeStream(buf);

                        if (my_btmp != null) {
                            c.photo = my_btmp;
                            c.id = id;
                            c.name = name;
                            c.photoURL = saveToSD(my_btmp, id);
                            contactList.add(c);
                        }
                    }
                }
                cur.close();



            } catch (Exception e) {
                Log.v("hata", e.toString());
                return 0;
            }

            return 1;
        }
</code></pre>
