This sample demonstrates how to create a list-based widget specifically backed by a content provider.
Please make sure that you understand the earlier stack widget sample code before delving into this example (see StackWidget).

As in the StackWidget example, we will be using a collection view (the ListView in this case) to present some mock weather data in a widget. In particular, we will be using a content provider to demonstrate how the widget can retrieve data and update itself when you are using more complex data sources. When working with external data, or data which must be fetched over high latency, it is important to keep the data cached in a persistent location so that the widget feels responsive.

This sample uses the following classes:

If you are writing collection-based widgets, remember that the feature is supported only on Android 3.0 (API level 11) and higher versions of the platform. Remember to add the following to the application's manifest publishing to Google Play:

Screenshot