From c5517b3e7212c3561f8682e6746c94279416bb82 Mon Sep 17 00:00:00 2001 From: Jay Shrauner Date: Fri, 21 Mar 2014 14:54:45 -0700 Subject: Protect against class cast exception DO NOT MERGE Missed instance of this problem in saveOffsets() in previous fix made to onPreDraw() Bug:12228894 Change-Id: I9bd9596f670f4fe8eb355fccd1c0641e5ee37306 (cherry picked from commit e3b3b4a864d8c417217e3cff847f63f165cb4141) --- src/com/android/dialer/list/PhoneFavoriteFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java index 354765f77..0d33b4c85 100644 --- a/src/com/android/dialer/list/PhoneFavoriteFragment.java +++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java @@ -444,7 +444,8 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen final int position = firstVisiblePosition + i; final long itemId = mAdapter.getItemId(position); final int itemViewType = mAdapter.getItemViewType(position); - if (itemViewType == PhoneFavoritesTileAdapter.ViewTypes.TOP) { + if (itemViewType == PhoneFavoritesTileAdapter.ViewTypes.TOP && + child instanceof ContactTileRow) { // This is a tiled row, so save horizontal offsets instead saveHorizontalOffsets((ContactTileRow) child, (ArrayList) mAdapter.getItem(position), -- cgit v1.2.3