Add bounds check in TabLayout#getTabAt(int).

Added bound check prevents crashes when an app calls notifyDataSetChanged
on a PagerAdapter after items' position changes and ViewPager dispatches
onPageSelected to TabLayout. See details more detais in the bug.

Bug:
https://code.google.com/p/android/issues/detail?id=199514
https://code.google.com/p/android/issues/detail?id=213470

Change-Id: Ie04e6d3ce4b39566e5a378b056b33993db4783e2
1 file changed