public class FindNetworkActivity.SectionsPagerAdapter
extends FragmentPagerAdapter
FragmentPagerAdapter
that returns a fragment corresponding to
one of the two available tabs: From
, for location-based networks, and Speaks
,
for language-based networks.Constructor and Description |
---|
SectionsPagerAdapter(FragmentManager fm) |
Modifier and Type | Method and Description |
---|---|
int |
getCount()
Always returns
2 because there are 2 tabs |
Fragment |
getItem(int position)
Get the appropriate fragment depending on which tab is selected
|
java.lang.CharSequence |
getPageTitle(int position)
Get the titles for each tab
|
public Fragment getItem(int position)
position
- Either 0
, for near
or 1
, for speaks
FindNetworkActivity.FindLocationFragment
for position=1
, FindNetworkActivity.FindLanguageFragment
otherwise.public int getCount()
2
because there are 2 tabs2
public java.lang.CharSequence getPageTitle(int position)
position
- Position of tab to get name of (0
or 1
)