Working Sample: Test Home Screen List Widget
This home screen list widget sample will demonstrate the ideas covered thus far about list-based home screen widgets. At the end of this sample, you will see a list-based widget that you can drag onto the home screen. When you drag it, you will see a widget displaying 20 rows of list items filled with sample text. When you click one of these list item rows, you will see a Toast on the home screen containing text from that specific row of the list.
Here is the list of files you will need:
TestListWidgetProvider.javais the primary class; it’s the test widget provider that implements a widget with a list view as one of its views (Listing 26–21).
TestRemoteViewsFactory.javais the class that provides ...