Android PagerAdapter X of Y

Recently saw NumericPageIndicator¬†noted in the Android developer weekly email and thought I’d share my simpler solution to having page X of Y in a view

Gmail's X of Y pager

Gmail’s X of Y pager

pager indicator.

PagerAdapter X of Y. When using a view pager you can simply override the getPageTitle to create a page x of y text as seen in apps like gmail. This was used in a app to swipe through the RSS stories with

Alternatively you could use something like 

Gist after the break