Skip to content

Commit

Permalink
Merge pull request emilsjolander#160 from Teods/master
Browse files Browse the repository at this point in the history
Add version checking when getting AbslistView element "mSelectorPosition...
  • Loading branch information
emilsjolander committed Aug 18, 2013
2 parents 62be7e8 + 29f2547 commit d7f6fc4
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ public StickyListHeadersListView(Context context, AttributeSet attrs,
selectorRectField.setAccessible(true);
mSelectorRect = (Rect) selectorRectField.get(this);

mSelectorPositionField = AbsListView.class
.getDeclaredField("mSelectorPosition");
mSelectorPositionField.setAccessible(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
mSelectorPositionField = AbsListView.class.getDeclaredField("mSelectorPosition");
mSelectorPositionField.setAccessible(true);
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
Expand Down

0 comments on commit d7f6fc4

Please sign in to comment.