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
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
See
getCount() | |||||||||||
See
getItemId(int) . | |||||||||||
This allows for the use of a custom loading view which appears between the time that
getViewAt(int) is called and returns. | |||||||||||
See
getViewTypeCount() . | |||||||||||
See
hasStableIds() . | |||||||||||
Called when your factory is first constructed.
| |||||||||||
Called when notifyDataSetChanged() is triggered on the remote adapter.
| |||||||||||
Called when the last RemoteViewsAdapter that is associated with this factory is
unbound.
|
See getItemId(int)
.
position | The position of the item within the data set whose row id we want. |
---|
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.
See 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()
.
position | The position of the item within the Factory's data set of the item whose view we want. |
---|
See getViewTypeCount()
.
See hasStableIds()
.
Called when your factory is first constructed. The same factory may be shared across multiple RemoteViewAdapters depending on the intent passed.
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.
Called when the last RemoteViewsAdapter that is associated with this factory is unbound.