From e3b3b4a864d8c417217e3cff847f63f165cb4141 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 Missed instance of this problem in saveOffsets() in previous fix made to onPreDraw() Bug:12228894 Change-Id: I9bd9596f670f4fe8eb355fccd1c0641e5ee37306 --- src/com/android/dialer/list/PhoneFavoriteFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java index 0b191416d..5f5e55cd1 100644 --- a/src/com/android/dialer/list/PhoneFavoriteFragment.java +++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java @@ -441,7 +441,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