# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

# RemoteViewsService.RemoteViewsFactory

`public static interface RemoteViewsService.RemoteViewsFactory`
``

android.widget.RemoteViewsService.RemoteViewsFactory

An interface for an adapter between a remote collection view (ListView, GridView, etc) and the underlying data for that view. The implementor is responsible for making a RemoteView for each item in the data set. This interface is a thin wrapper around `Adapter`.

See also:

- `Adapter`
- `AppWidgetManager`

## Summary

### Public methods
`abstract int` | `getCount()` See `Adapter#getCount()`
`abstract long` | `getItemId(int position)` See `Adapter#getItemId(int)`.
`abstract RemoteViews` | `getLoadingView()` This allows for the use of a custom loading view which appears between the time that `getViewAt(int)` is called and returns.
`abstract RemoteViews` | `getViewAt(int position)` See `Adapter#getView(int, android.view.View, android.view.ViewGroup)`.
`abstract int` | `getViewTypeCount()` See `Adapter#getViewTypeCount()`.
`abstract boolean` | `hasStableIds()` See `Adapter#hasStableIds()`.
`abstract void` | `onCreate()` Called when your factory is first constructed.
`abstract void` | `onDataSetChanged()` Called when notifyDataSetChanged() is triggered on the remote adapter.
`abstract void` | `onDestroy()` Called when the last RemoteViewsAdapter that is associated with this factory is unbound.

## Public methods

### getCount

    public abstract int getCount ()

See `Adapter#getCount()`

Returns
`int` | Count of items.

### getItemId

    public abstract long getItemId (int position)

See `Adapter#getItemId(int)`.

Parameters
`position` | `int`: The position of the item within the data set whose row id we want.

Returns
`long` | The id of the item at the specified position.

### getLoadingView

    public abstract RemoteViews getLoadingView ()

This allows for the use of a custom loading view which appears between the time that `getViewAt(int)` is called and returns. If null is returned, a default loading view will be used.

Returns
`RemoteViews` | The RemoteViews representing the desired loading view.

### getViewAt

    public abstract RemoteViews getViewAt (int position)

See `Adapter#getView(int, android.view.View, android.view.ViewGroup)`. Note: expensive tasks can be safely performed synchronously within this method, and a loading view will be displayed in the interim. See `getLoadingView()`.

Parameters
`position` | `int`: The position of the item within the Factory's data set of the item whose view we want.

Returns
`RemoteViews` | A RemoteViews object corresponding to the data at the specified position.

### getViewTypeCount

    public abstract int getViewTypeCount ()

See `Adapter#getViewTypeCount()`.

Returns
`int` | The number of types of Views that will be returned by this factory.

### hasStableIds

    public abstract boolean hasStableIds ()

See `Adapter#hasStableIds()`.

Returns
`boolean` | True if the same id always refers to the same object.

### onCreate

    public abstract void onCreate ()

Called when your factory is first constructed. The same factory may be shared across multiple RemoteViewAdapters depending on the intent passed.

### onDataSetChanged

    public abstract void onDataSetChanged ()

Called when notifyDataSetChanged() is triggered on the remote adapter. This allows a RemoteViewsFactory to respond to data changes by updating any internal references. Note: expensive tasks can be safely performed synchronously within this method. In the interim, the old data will be displayed within the widget.

See also:

- `AppWidgetManager.notifyAppWidgetViewDataChanged(int[], int)`

### onDestroy

    public abstract void onDestroy ()

Called when the last RemoteViewsAdapter that is associated with this factory is unbound.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*