This is the last of the widgets in our Widget Samples series. All but the simplest widgets are likely to benefit from using multiple pages. The Multipage sample implements a two-page, list-based widget that demonstrates basic page building and switching techniques.
On launch, the widget displays a Navigation list; selecting an item from the list builds and switches to an appropriate details list; a back button returns the user to the main page. It's a simple example, but the techniques are universally useful. You can reuse the sample code as a starting point for your own projects.
The screenshots below show the Multipage sample widget running on the HTC Desire:
Image may be NSFW.
Clik here to view.Image may be NSFW.
Clik here to view.
Read the Code Notes
Like all samples in the series we're publishing the complete source code together with detailed Code Notes which walk through the files in detail.
You can download the source code and find the Code Notes here.
What's in the download
The download includes:
- Fully commented source code, ready to build
- README.txt
The widget is compatible with the latest Android phones on Vodafone, as well as the Nokia N8.