Question: I am using the android design library TabLayout in that how can I get the current selected item tab position.

```
  ViewPager pager = (ViewPager) view.findViewById(R.id.pager);      
  MyPagerAdapter adapter = new MyPagerAdapter(getChildFragmentManager());
  pager.setAdapter(adapter);
  tabLayout.setupWithViewPager(pager);

```

Answer: 
As of version 22.2.1 of the Support library the [TabLayout](http://developer.android.com/reference/android/support/design/widget/TabLayout.html) has a method `getSelectedTabPosition`.

[Source 1](https://plus.google.com/+AndroidDevelopers/posts/XTtNCPviwpj) | [Source 2](https://developer.android.com/sdk/support_api_diff/22.2.1/changes.html#AndroidDev)
You can call ViewPager's [`getCurrentItem()`](http://developer.android.com/reference/android/support/v4/view/ViewPager.html#getCurrentItem()) to get the index of the currently displayed item.