如何在列表视图的点击事件中设置多个意图?

时间:2019-02-27 17:24:49

标签: android listview android-intent

我也想将此id,title,teamname1和teamname2带到另一个活动中。 我不知道该怎么做 预先感谢。

  

代码:

votingforc c = new votingforc(Voting.this, name, img1, img2, series);
                            listView.setAdapter(c);
                            listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                                @Override
                                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                                    Intent intent = new Intent(Voting.this, VotingForCVc.class);
                                    intent.putExtra("id", id1.get(position));
                                    intent.putExtra("title", name.get(position));
                                    intent.putExtra("teamname1", teamname1.get(position));
                                    intent.putExtra("teamname2", teamname2.get(position));
                                    startActivity(intent);
                                }
                            });

0 个答案:

没有答案