I'm trying to make the listrows in my ListView Widget clickable by using the setOnClickFillInIntent
method but whenever I click a ListItem nothing happends. Here are some key parts of my code:
Intent i = new Intent();
Bundle extras = new Bundle();
extras.putInt(Resource.WIDGET_PACKAGE, position);
i.putExtras(extras);
row.setOnClickFillInIntent(R.id.widget_layout_parent, i);
This is at the end of getView()
in my ViewFactory. Resource.WIDGET_PACKAGE contains my package name and is just like any other key. The position int is from the getView()
parameters. R.id.widget_layout_parent
is the parent layout in all of the list items.
Here's the end of my WidgetProviders onUpdate()
Intent clickIntent = new Intent(context, ItemListActivity.class);
PendingIntent clickPI = PendingIntent.getActivity(context, 0,
clickIntent, PendingIntent.FLAG_UPDATE_CURRENT);
widget.setPendingIntentTemplate(R.id.widget_layout_parent, clickPI);
appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds[i],
R.id.widget_list_view);
Is there something I'm missing or is there anything else you'd like to know?
All help is appreciated! :)