instantiateItem

open fun instantiateItem(@NonNull container: ViewGroup, position: Int): Any(source)

Create the page for the given position. The adapter is responsible for adding the view to the container given here, although it only must ensure this is done by the time it returns from finishUpdate.

Return

Returns an Object representing the new page. This does not need to be a View, but can be some other container of the page.

Parameters

container

The containing View in which the page will be shown.

position

The page position to be instantiated.


open fun instantiateItem(@NonNull container: View, position: Int): Any(source)

Deprecated

Use instantiateItem

Create the page for the given position. The adapter is responsible for adding the view to the container given here, although it only must ensure this is done by the time it returns from finishUpdate.

Return

Returns an Object representing the new page. This does not need to be a View, but can be some other container of the page.

Parameters

container

The containing View in which the page will be shown.

position

The page position to be instantiated.