# GridPagerAdapter

Summary:[Constants](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter#constants)\|[Fields](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter#lfields)\|[Ctors](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter#pubctors)\|[Methods](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter#inhmethods)  

# GridPagerAdapter

`
public


abstract
class
GridPagerAdapter
`  
`

extends `[Object](http://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|------------------------------------------------|
| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.wearable.view.GridPagerAdapter |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [FragmentGridPagerAdapter](https://developer.android.com/reference/android/support/wearable/view/FragmentGridPagerAdapter.html) |---------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [FragmentGridPagerAdapter](https://developer.android.com/reference/android/support/wearable/view/FragmentGridPagerAdapter.html) | *This class is deprecated. starting with Android Wear 2.0 we no longer encourage bi-directional spacial models for apps. If you are looking to implement vertical paging pattern, consider using the[SnapHelper](https://developer.android.com/reference/android/support/v7/widget/SnapHelper.html)and a[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html)instead.* | |

<br />

*** ** * ** ***

<br />

**This class is deprecated.**   
starting with Android Wear 2.0 we no longer encourage bi-directional spacial models for apps. If you are looking to implement vertical paging pattern, consider using the[SnapHelper](https://developer.android.com/reference/android/support/v7/widget/SnapHelper.html)and a[RecyclerView](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html)instead.

This component is responsible for providing views requested by a[GridViewPager](https://developer.android.com/reference/android/support/wearable/view/GridViewPager.html).

Content is organized into rows and columns of pages, where each page is represented by a View. Each row may contain a different number of columns.

In addition to content views, this adapter is also queried for backgrounds to be displayed for each page. When the same background spans multiple pages, it's automatically zoomed and panned to create a parallax effect against the movement of the page content as it moves. By default, no background is provided.

## Summary

|                                                                                                  ### Constants                                                                                                   ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [OPTION_DISABLE_PARALLAX](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#OPTION_DISABLE_PARALLAX) Disables zooming and parallax scrolling of the background. |
| `int` | [PAGE_DEFAULT_OPTIONS](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#PAGE_DEFAULT_OPTIONS) Default background options.                                      |

|                                                                                                                                               ### Fields                                                                                                                                                ||
|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Drawable](http://developer.android.com/reference/android/graphics/drawable/Drawable.html) | [BACKGROUND_NONE](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#BACKGROUND_NONE) This value indicates that no background should drawn. |
| ` public static final `[Point](http://developer.android.com/reference/android/graphics/Point.html)                | [POSITION_NONE](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#POSITION_NONE) <br />                                                    |
| ` public static final `[Point](http://developer.android.com/reference/android/graphics/Point.html)                | [POSITION_UNCHANGED](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#POSITION_UNCHANGED) <br />                                          |

|                                                            ### Public constructors                                                            ||
|--------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[GridPagerAdapter](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#GridPagerAdapter())`() ` |

|                                                                                                                                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                                                                                                                                      ||
|-----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void`                                                                              | ` `[destroyItem](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#destroyItem(android.view.ViewGroup,%20int,%20int,%20java.lang.Object))`(`[ViewGroup](http://developer.android.com/reference/android/view/ViewGroup.html)` container, int row, int column, `[Object](http://developer.android.com/reference/java/lang/Object.html)` object) ` Removes a page for the given position.                                                                                                                                                                                              |
| ` void`                                                                                       | ` `[finishUpdate](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#finishUpdate(android.view.ViewGroup))`(`[ViewGroup](http://developer.android.com/reference/android/view/ViewGroup.html)` container) ` Called when the a change in the shown pages has been completed.                                                                                                                                                                                                                                                                                                           |
| ` `[Drawable](http://developer.android.com/reference/android/graphics/drawable/Drawable.html) | ` `[getBackgroundForPage](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForPage(int,%20int))`(int row, int column) ` Provides content to be displayed as background for a specific page.                                                                                                                                                                                                                                                                                                                                                                           |
| ` `[Drawable](http://developer.android.com/reference/android/graphics/drawable/Drawable.html) | ` `[getBackgroundForRow](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForRow(int))`(int row) ` Provides content to be displayed as the default background for all pages on the given row.                                                                                                                                                                                                                                                                                                                                                                         |
| ` abstract int`                                                                               | ` `[getColumnCount](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getColumnCount(int))`(int row) ` Returns the maximum number of columns for each row.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` int`                                                                                        | ` `[getCurrentColumnForRow](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getCurrentColumnForRow(int,%20int))`(int row, int currentColumn) ` Returns the column to arrive at when navigating vertically to the specified row.                                                                                                                                                                                                                                                                                                                                                   |
| ` `[Point](http://developer.android.com/reference/android/graphics/Point.html)                | ` `[getItemPosition](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getItemPosition(java.lang.Object))`(`[Object](http://developer.android.com/reference/java/lang/Object.html)` object) ` Called when the host view is attempting to determine if an item's position has changed.                                                                                                                                                                                                                                                                                               |
| ` int`                                                                                        | ` `[getOptionsForPage](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getOptionsForPage(int,%20int))`(int row, int column) ` Provides a set of features to apply to a page background.                                                                                                                                                                                                                                                                                                                                                                                           |
| ` abstract int`                                                                               | ` `[getRowCount](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getRowCount())`() ` Returns the number of rows available.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` abstract `[Object](http://developer.android.com/reference/java/lang/Object.html)            | ` `[instantiateItem](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#instantiateItem(android.view.ViewGroup,%20int,%20int))`(`[ViewGroup](http://developer.android.com/reference/android/view/ViewGroup.html)` container, int row, int column) ` Creates the page for the given position.                                                                                                                                                                                                                                                                                         |
| ` abstract boolean`                                                                           | ` `[isViewFromObject](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#isViewFromObject(android.view.View,%20java.lang.Object))`(`[View](http://developer.android.com/reference/android/view/View.html)` view, `[Object](http://developer.android.com/reference/java/lang/Object.html)` object) ` Determines whether a page View is associated with a specific key object as returned by[instantiateItem(ViewGroup, int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#instantiateItem(android.view.ViewGroup,%20int,%20int)). |
| ` void`                                                                                       | ` `[notifyDataSetChanged](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#notifyDataSetChanged())`() ` This method should be called by the application if the data backing this adapter has changed and associated views should update.                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                       | ` `[notifyPageBackgroundChanged](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#notifyPageBackgroundChanged(int,%20int))`(int row, int column) ` This method should be called if the value returned by[getBackgroundForPage(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForPage(int,%20int))or options returned by[getOptionsForPage(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getOptionsForPage(int,%20int))change.                        |
| ` void`                                                                                       | ` `[notifyRowBackgroundChanged](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#notifyRowBackgroundChanged(int))`(int row) ` This method should be called if the value returned by[getBackgroundForRow(int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForRow(int))changes.                                                                                                                                                                                                                                        |
| ` void`                                                                                       | ` `[registerDataSetObserver](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#registerDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](http://developer.android.com/reference/android/database/DataSetObserver.html)` observer) ` Register an observer to receive callbacks related to the adapter's data changing.                                                                                                                                                                                                                                          |
| ` void`                                                                                       | ` `[restoreState](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#restoreState(android.os.Parcelable,%20java.lang.ClassLoader))`(`[Parcelable](http://developer.android.com/reference/android/os/Parcelable.html)` savedState, `[ClassLoader](http://developer.android.com/reference/java/lang/ClassLoader.html)` classLoader) ` Restores the previously saved state of this adapter.                                                                                                                                                                                             |
| ` `[Parcelable](http://developer.android.com/reference/android/os/Parcelable.html)            | ` `[saveState](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#saveState())`() ` Saves the current state of this adapter.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` void`                                                                                       | ` `[setCurrentColumnForRow](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#setCurrentColumnForRow(int,%20int))`(int row, int currentColumn) ` Called to inform the adapter of which column is now current for the given row.                                                                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                       | ` `[startUpdate](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#startUpdate(android.view.ViewGroup))`(`[ViewGroup](http://developer.android.com/reference/android/view/ViewGroup.html)` container) ` Called when a change in the shown pages is going to start being made.                                                                                                                                                                                                                                                                                                       |
| ` void`                                                                                       | ` `[unregisterDataSetObserver](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#unregisterDataSetObserver(android.database.DataSetObserver))`(`[DataSetObserver](http://developer.android.com/reference/android/database/DataSetObserver.html)` observer) ` Unregister an observer from callbacks related to the adapter's data changing.                                                                                                                                                                                                                                          |

|                                                                                                                                                                                                                                                                                                                                                                                    ### Protected methods                                                                                                                                                                                                                                                                                                                                                                                    ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[applyItemPosition](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#applyItemPosition(java.lang.Object,%20android.graphics.Point))`(`[Object](http://developer.android.com/reference/java/lang/Object.html)` object, `[Point](http://developer.android.com/reference/android/graphics/Point.html)` position) ` Called after[getItemPosition(Object)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getItemPosition(java.lang.Object))to allow superclasses to update their internal bookkeeping if a subclass has overridden[getItemPosition(Object)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getItemPosition(java.lang.Object)). |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                               | | ` boolean`                                                                         | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                            | ` finalize() `                                                                            | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                            | | ` int`                                                                             | ` hashCode() `                                                                            | | ` final void`                                                                      | ` notify() `                                                                              | | ` final void`                                                                      | ` notifyAll() `                                                                           | | ` `[String](http://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                            | | ` final void`                                                                      | ` wait(long arg0, int arg1) `                                                             | | ` final void`                                                                      | ` wait(long arg0) `                                                                       | | ` final void`                                                                      | ` wait() `                                                                                | ||

## Constants

### OPTION_DISABLE_PARALLAX

```
public static final int OPTION_DISABLE_PARALLAX
```

Disables zooming and parallax scrolling of the background.

<br />

Constant Value: 1 (0x00000001)  

### PAGE_DEFAULT_OPTIONS

```
public static final int PAGE_DEFAULT_OPTIONS
```

Default background options. Parallax scrolling is enabled.

<br />

Constant Value: 0 (0x00000000)

## Fields

### BACKGROUND_NONE

```
public static final Drawable BACKGROUND_NONE
```

This value indicates that no background should drawn. See[getBackgroundForRow(int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForRow(int))and[getBackgroundForPage(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForPage(int,%20int))for specific effects.

<br />

### POSITION_NONE

```
public static final Point POSITION_NONE
```

<br />

<br />

### POSITION_UNCHANGED

```
public static final Point POSITION_UNCHANGED
```

<br />

<br />

## Public constructors

### GridPagerAdapter

```
public GridPagerAdapter ()
```

<br />

<br />

## Public methods

### destroyItem

```
public abstract void destroyItem (ViewGroup container, 
                int row, 
                int column, 
                Object object)
```

Removes a page for the given position. The adapter is responsible for removing the view from its container, although it only must ensure this is done by the time it returns from[finishUpdate(ViewGroup)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#finishUpdate(android.view.ViewGroup)).

<br />

|                                                                                                                          Parameters                                                                                                                          ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `container` | `ViewGroup`: The containing View from which the page will be removed. <br />                                                                                                                                                                    |
| `row`       | `int`: the row to be destroyed <br />                                                                                                                                                                                                           |
| `column`    | `int`: the column within the row to be destroyed <br />                                                                                                                                                                                         |
| `object`    | `Object`: The same object that was returned by[instantiateItem(ViewGroup, int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#instantiateItem(android.view.ViewGroup,%20int,%20int)). <br /> |

### finishUpdate

```
public void finishUpdate (ViewGroup container)
```

Called when the a change in the shown pages has been completed. At this point you must ensure that all of the pages have actually been added or removed from the container as appropriate.

<br />

|                                             Parameters                                             ||
|-------------|---------------------------------------------------------------------------------------|
| `container` | `ViewGroup`: The containing View which is displaying this adapter's page views <br /> |

### getBackgroundForPage

```
public Drawable getBackgroundForPage (int row, 
                int column)
```

Provides content to be displayed as background for a specific page.

The return value[BACKGROUND_NONE](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#BACKGROUND_NONE)indicates that there is no page-specific background. and the row background should be used (if any).

The return value of this method can be cached.[notifyPageBackgroundChanged(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#notifyPageBackgroundChanged(int,%20int))may be used to invalidate a previously returned value.[getBackgroundForPage(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForPage(int,%20int))will then be called to request the new value when necessary.

<br />

|                   Parameters                   ||
|----------|--------------------------------------|
| `row`    | `int`: the row of the page <br />    |
| `column` | `int`: the column of the page <br /> |

|                                              Returns                                               ||
|--------------------------------------------------------------------------------------------|--------|
| [Drawable](http://developer.android.com/reference/android/graphics/drawable/Drawable.html) | <br /> |

### getBackgroundForRow

```
public Drawable getBackgroundForRow (int row)
```

Provides content to be displayed as the default background for all pages on the given row.

The return value[BACKGROUND_NONE](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#BACKGROUND_NONE)causes no background to be displayed, except for those applied by[getBackgroundForPage(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForPage(int,%20int)).

The return value of this method can be cached.[notifyRowBackgroundChanged(int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#notifyRowBackgroundChanged(int))may be used to invalidate a previously returned value.[getBackgroundForRow(int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForRow(int))will then be called to request the new value when necessary.

<br />

|                Parameters                ||
|-------|-----------------------------------|
| `row` | `int`: the row of the page <br /> |

|                                                               Returns                                                                ||
|--------------------------------------------------------------------------------------------|------------------------------------------|
| [Drawable](http://developer.android.com/reference/android/graphics/drawable/Drawable.html) | a drawable to display for the row <br /> |

### getColumnCount

```
public abstract int getColumnCount (int row)
```

Returns the maximum number of columns for each row. The number of columns may vary by row.

<br />

|     Parameters      ||
|-------|--------------|
| `row` | `int` <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getCurrentColumnForRow

```
public int getCurrentColumnForRow (int row, 
                int currentColumn)
```

Returns the column to arrive at when navigating vertically to the specified row.

The default implementation simply returns 0.

<br />

|                              Parameters                               ||
|-----------------|------------------------------------------------------|
| `row`           | `int`: the row in question <br />                    |
| `currentColumn` | `int`: the column which is currently centered <br /> |

|                Returns                ||
|-------|--------------------------------|
| `int` | the column to arrive at <br /> |

### getItemPosition

```
public Point getItemPosition (Object object)
```

Called when the host view is attempting to determine if an item's position has changed. Returns[POSITION_UNCHANGED](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#POSITION_UNCHANGED)if the position of the given item has not changed or[POSITION_NONE](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#POSITION_NONE)if the item is no longer present in the adapter.

The default implementation assumes that all items have been removed and always returns[POSITION_NONE](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#POSITION_NONE). This causes all fragments to be detached and re-attached as needed.

<br />

|                                                                                                                                     Parameters                                                                                                                                     ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `object` | `Object`: Object representing an item, previously returned by a call to[instantiateItem(ViewGroup, int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#instantiateItem(android.view.ViewGroup,%20int,%20int)). <br /> |

|                                                                                                                                                                                                                                                               Returns                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Point](http://developer.android.com/reference/android/graphics/Point.html) | object's new position with row from \[0, getRowCount()\] and column from \[0, getColumnCount(row)\],[POSITION_UNCHANGED](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#POSITION_UNCHANGED)if the object's position has not changed, or[POSITION_NONE](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#POSITION_NONE)if the item is no longer present. <br /> |

### getOptionsForPage

```
public int getOptionsForPage (int row, 
                int column)
```

Provides a set of features to apply to a page background. The return value should be a combination of one or more of the following, combined via bitwise-or:

- [OPTION_DISABLE_PARALLAX](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#OPTION_DISABLE_PARALLAX)

The default return value is[PAGE_DEFAULT_OPTIONS](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#PAGE_DEFAULT_OPTIONS).

<br />

<br />

|                   Parameters                   ||
|----------|--------------------------------------|
| `row`    | `int`: the row of the page <br />    |
| `column` | `int`: the column of the page <br /> |

|                       Returns                       ||
|-------|----------------------------------------------|
| `int` | a bitwise OR of all requested options <br /> |

### getRowCount

```
public abstract int getRowCount ()
```

Returns the number of rows available.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### instantiateItem

```
public abstract Object instantiateItem (ViewGroup container, 
                int row, 
                int column)
```

Creates 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(ViewGroup)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#finishUpdate(android.view.ViewGroup))

<br />

|                                    Parameters                                    ||
|-------------|---------------------------------------------------------------------|
| `container` | `ViewGroup`: containing View in which the page will be shown <br /> |
| `row`       | `int`: the row to be instantiated <br />                            |
| `column`    | `int`: the column within the row to be instantiated <br />          |

|                                                       Returns                                                        ||
|------------------------------------------------------------------------|----------------------------------------------|
| [Object](http://developer.android.com/reference/java/lang/Object.html) | a an object representing the new page <br /> |

### isViewFromObject

```
public abstract boolean isViewFromObject (View view, 
                Object object)
```

Determines whether a page View is associated with a specific key object as returned by[instantiateItem(ViewGroup, int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#instantiateItem(android.view.ViewGroup,%20int,%20int)). This method is required for a PagerAdapter to function properly.

<br />

|                                Parameters                                ||
|----------|----------------------------------------------------------------|
| `view`   | `View`: Page View to check for association with`object` <br /> |
| `object` | `Object`: Object to check for association with`view` <br />    |

|                                 Returns                                  ||
|-----------|---------------------------------------------------------------|
| `boolean` | true if`view`is associated with the key object`object` <br /> |

### notifyDataSetChanged

```
public void notifyDataSetChanged ()
```

This method should be called by the application if the data backing this adapter has changed and associated views should update.

<br />

### notifyPageBackgroundChanged

```
public void notifyPageBackgroundChanged (int row, 
                int column)
```

This method should be called if the value returned by[getBackgroundForPage(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForPage(int,%20int))or options returned by[getOptionsForPage(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getOptionsForPage(int,%20int))change. Any cached value are removed and the the new value will be requested when necessary.

<br />

|       Parameters       ||
|----------|--------------|
| `row`    | `int` <br /> |
| `column` | `int` <br /> |

### notifyRowBackgroundChanged

```
public void notifyRowBackgroundChanged (int row)
```

This method should be called if the value returned by[getBackgroundForRow(int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getBackgroundForRow(int))changes. Any cached value is removed and the the new value will be requested when necessary.

<br />

|     Parameters      ||
|-------|--------------|
| `row` | `int` <br /> |

### registerDataSetObserver

```
public void registerDataSetObserver (DataSetObserver observer)
```

Register an observer to receive callbacks related to the adapter's data changing.

<br />

|                                                                              Parameters                                                                               ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `observer` | `DataSetObserver`: The[DataSetObserver](http://developer.android.com/reference/android/database/DataSetObserver.html)which will receive callbacks. <br /> |

### restoreState

```
public void restoreState (Parcelable savedState, 
                ClassLoader classLoader)
```

Restores the previously saved state of this adapter.

<br />

|             Parameters              ||
|---------------|----------------------|
| `savedState`  | `Parcelable` <br />  |
| `classLoader` | `ClassLoader` <br /> |

### saveState

```
public Parcelable saveState ()
```

Saves the current state of this adapter.

<br />

|                                         Returns                                         ||
|---------------------------------------------------------------------------------|--------|
| [Parcelable](http://developer.android.com/reference/android/os/Parcelable.html) | <br /> |

### setCurrentColumnForRow

```
public void setCurrentColumnForRow (int row, 
                int currentColumn)
```

Called to inform the adapter of which column is now current for the given row. This information could be stored and used to implement[getCurrentColumnForRow(int, int)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getCurrentColumnForRow(int,%20int)). The default implementation does nothing.

<br />

|                           Parameters                           ||
|-----------------|-----------------------------------------------|
| `row`           | `int`: the row for the column change <br />   |
| `currentColumn` | `int`: the column which is now current <br /> |

### startUpdate

```
public void startUpdate (ViewGroup container)
```

Called when a change in the shown pages is going to start being made.

<br />

|                                             Parameters                                              ||
|-------------|----------------------------------------------------------------------------------------|
| `container` | `ViewGroup`: The containing View which is displaying this adapter's page views. <br /> |

### unregisterDataSetObserver

```
public void unregisterDataSetObserver (DataSetObserver observer)
```

Unregister an observer from callbacks related to the adapter's data changing.

<br />

|                                                                             Parameters                                                                              ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `observer` | `DataSetObserver`: The[DataSetObserver](http://developer.android.com/reference/android/database/DataSetObserver.html)which will be unregistered. <br /> |

## Protected methods

### applyItemPosition

```
protected void applyItemPosition (Object object, 
                Point position)
```

Called after[getItemPosition(Object)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getItemPosition(java.lang.Object))to allow superclasses to update their internal bookkeeping if a subclass has overridden[getItemPosition(Object)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getItemPosition(java.lang.Object)).

<br />

|                                                                                                          Parameters                                                                                                          ||
|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `object`   | `Object`: Object representing the item passed to[getItemPosition(Object)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getItemPosition(java.lang.Object)). <br /> |
| `position` | `Point`: position which was returned from[getItemPosition(Object)](https://developer.android.com/reference/android/support/wearable/view/GridPagerAdapter.html#getItemPosition(java.lang.Object)). <br />        |