I have implemented a QuickAction menu using the code and tutorial found here.
I have a ListView that I populate with records from a SQLite DB and when a record is clicked the QuickAction menu is displayed. What I don't know how to do is take action on the selected record using the QuickAction items (e.g. update the selected record in the DB when a QuickAction item is selected).
Here is my QuickAction onclick listener:
quickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener()
{
@Override
public void onItemClick(QuickAction source, int pos, int actionId)
{
ActionItem actionItem = quickAction.getActionItem(pos);
if (actionId == VIEW)
{
[view the record]
}
else if (actionId == UPDATE)
{
[update a value in the db]
}
else
{
[do something else to the record]
}
}
});
Pass to OnItemClick only the position. For updating records you can use putExtra methods: