Merge change 22961 into eclair

* changes:
  Fix strings whose apostrophes were eaten because of the lack of a backslash.
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 42a1d04..cefbf11 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -687,6 +687,7 @@
         // in response to onRestart() setLoading(false) will be called.
         mAdapter.setLoading(true);
         mAdapter.changeCursor(null);
+        mAdapter.clearImageFetching();
 
         if (mMode == MODE_QUERY) {
             // Make sure the search box is closed
@@ -1622,7 +1623,7 @@
                         int pos = (Integer) imageView.getTag();
                         Cursor cursor = (Cursor) getItem(pos);
 
-                        if (!cursor.isNull(SUMMARY_PHOTO_ID_COLUMN_INDEX)) {
+                        if (cursor != null && !cursor.isNull(SUMMARY_PHOTO_ID_COLUMN_INDEX)) {
                             try {
                                 Bitmap photo = ContactsUtils.loadContactPhoto(
                                         mContext, cursor.getInt(SUMMARY_PHOTO_ID_COLUMN_INDEX),
@@ -2151,7 +2152,7 @@
             mScrollState = scrollState;
             if (scrollState != OnScrollListener.SCROLL_STATE_IDLE) {
                 // If we are not idle, stop loading images.
-                mHandler.clearImageFecthing();
+                clearImageFetching();
             } else if (mDisplayPhotos) {
                 processMissingImageItems(view);
             }
@@ -2170,5 +2171,10 @@
             msg.obj = view;
             mHandler.sendMessage(msg);
         }
+
+        /** Clear all pending messages on the {@link ImageFetchHandler} */
+        public void clearImageFetching() {
+            mHandler.clearImageFecthing();
+        }
     }
 }