You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.6 KiB

<p>
This sample shows how to construct a simple collection widget. This particular example shows how
to create a widget containing a <a href="../../../reference/android/widget/StackView.html"><code>StackView</code></a>
; however, only minimal changes are required to include
a <a href="../../../reference/android/widget/ListView.html"><code>ListView</code></a>,
<a href="../../../reference/android/widget/GridView.html"><code>GridView</code></a> or
<a href="../../../reference/android/widget/AdapterViewFlipper.html"><code>AdapterViewFlipper</code></a> instead.
</p>
<p>
The sample demonstrates the following:
</p>
<ul>
<li>
The pattern for creating and wiring a <a href="../../../reference/android/widget/RemoteViewsService.html"><code>RemoteViewsService</code></a>
and <a href="../../../reference/android/widget/RemoteViewsService.RemoteViewsFactory.html"><code>RemoteViewsFactory</code></a> which
serve the function of an adapter for the widget collection.
</li>
<li>
The pattern for setting an intent template and fill-in intents in order to
provide children of the collection with click behaviour.
</li>
<li>
How to make a widget with a <a href="../../../reference/android/widget/StackView.html"><code>StackView</code></a>
(or <a href="../../../reference/android/widget/AdapterViewFlipper.html"><code>AdapterViewFlipper</code></a>) auto-advance.
</li>
<li>
How to set a widget preview image.
</li>
</ul>
<img alt="The widget."
src="../images/StackWidget.png"/>