关于childclick列表器问题的可扩展listView

时间:2019-01-17 16:58:41

标签: java android listview arraylist

  listView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
            @Override
            public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i1, long l) {

                if((hashMap.get(grouplist.get(i)).get(i1)).equalsIgnoreCase(playerarrayList.get(i).getName())) {
                    Toast.makeText(PlayerStatisticsActivity.this, "" + playerarrayList.get(i).getId(), Toast.LENGTH_SHORT).show();
                }

                return false;
            }
        });

这是自定义课程列表

 playerarrayList.add(new PlayerId("Sarfraz Ahmed", 227760));
 playerarrayList.add(new PlayerId("Babar Azam", 348144));
 playerarrayList.add(new PlayerId("Faheem Ashraf", 681117));
 playerarrayList.add(new PlayerId("Fakhar Zaman", 512191));
 playerarrayList.add(new PlayerId("Hasan Ali", 681305));

我想将可扩展列表视图子名称与播放器列表名称进行比较,但这会导致问题,它仅显示ist标头的ist索引 请帮助

0 个答案:

没有答案