SachinGutte
SachinGutte

Reputation: 7055

passing customlist data to another activity

I know how to pass data from one activity to another. But what I want here is, I have custom list in which each row is having 3 columns and 3 rows. I have set up QuickActions to provide more actions related to each list item. When user clicks on a list item, QuickAction popup is appeared showing 4 actions for each item. List is generated from the response taken from server.

Here's a snapshot - QucikAction bar after clicking on a list item

Now when user clicks on Add , I want to pass suppose user_id. Similarly when user clicks on Accept I want pass post_id and likewise. user_id, post_id are not shown in list but they are already taken from server.

How can I do this ?

code from where I want to start new activity -

mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener()  {
public void onItemClick(QuickAction quickAction, int pos,int actionId) {
    ActionItem actionItem = quickAction.getActionItem(pos);
   if (actionId == ID_ADD) { 
       // if Add item selected , pick up data from current list item and start new  Intent. I can't figure out how can I get data for current item.
    } else {

        }

 }
});

Upvotes: 0

Views: 235

Answers (1)

RajaReddy PolamReddy
RajaReddy PolamReddy

Reputation: 22493

Use setTag() at the time of populating list view item's, write cod in getView() of custom adaptor. when you click on item in list view use getTag() property. and then pass through intents.

Upvotes: 2

Related Questions