It requires some additional steps.įirst you need to setup a template for PendingIntent. Click events on ListView itemsĪdding click events on ListView items is not as simple as setting up the setOnItemClickListener on the ListView object. But as widgets run in a different context, we need to register the click event through a PendingIntent. The idea here is similar to how we add click events in our apps. public class MyWidgetRemoteViewsFactory implements RemoteViewsService. Create a new Java class, name it MyWidgetRemoteViewsFactory, and set it to implement the class RemoteViewsService.RemoteViewsFactory. An adapter is used to connect the collection items(for example, ListView items or GridView items) with the data set. RemoteViewsFactory serves the purpose of an adapter in the widget’s context.
0 Comments
Leave a Reply. |