public class ViewPagerAdapter
extends FragmentPagerAdapter
| Constructor and Description |
|---|
ViewPagerAdapter(android.content.Context context,
FragmentManager fragmentManager,
java.util.List<ViewPagerItem> items)
Creates a new adapter, which allows to manage the fragments of a view pager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(java.lang.CharSequence title,
java.lang.Class<? extends Fragment> fragmentClass,
android.os.Bundle arguments)
Adds a new fragment to the adapter.
|
void |
clear()
Removes all fragments from the adapter.
|
int |
getCount() |
Fragment |
getItem(int index) |
java.lang.CharSequence |
getPageTitle(int position) |
void |
removeItem(int index)
Removes the fragment at a specific index from the adapter.
|
public ViewPagerAdapter(android.content.Context context,
FragmentManager fragmentManager,
java.util.List<ViewPagerItem> items)
context - The context, which should be used by the adapter, as an instance of the class Context. The context may not be nullfragmentManager - The fragment manager, which should be used by the adapter, as an instance of the
class FragmentManager. The fragment manager may not be nullitems - A list, which contains the adapter's items, as an instance of the type List.
The list may not be nullpublic final void addItem(java.lang.CharSequence title,
java.lang.Class<? extends Fragment> fragmentClass,
android.os.Bundle arguments)
title - The title of the fragment, which should be added, as an instance of the type CharSequence or null, if no title should be setfragmentClass - The class of the fragment, which should be added, as an instance of the class Class. The class may not be nullarguments - A bundle, which should be passed to the fragment, when it is shown, as an instance of
the class Bundle or null, if no arguments should be passed to the fragmentpublic final void removeItem(int index)
index - The index of the fragment, which should be removed, as an valuepublic final void clear()
public final Fragment getItem(int index)
public final int getCount()
public final java.lang.CharSequence getPageTitle(int position)