如何在列表视图Android的执行列表项autoclick [英] How to perform autoclick of List Items in listview Android

查看:140
本文介绍了如何在列表视图Android的执行列表项autoclick的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况,我需要一个与出单击该项目来处理每个列表项之一的点击。是否有一个方法可行,其中我能实现这个方案。
谁能帮我被这个问题整理出来。

由于提前


解决方案

  mList.performItemClick(
        。myList.getAdapter()getView(位置,NULL,NULL),位置,myList.getAdapter()getItemId(位置))。

在这里的位置是你的点击位置

或者干脆你可以做到这一点。

  mList.getAdapter()getView(位置,NULL,NULL).performClick()。

I had a scenario where I need to handle the clicks of each list item one by one with out clicking on that item. Is there a possiblity in which I can achieve this scenario. Can anyone help me is sorting out this issue.

Thanks in Advance

解决方案

mList.performItemClick(
        myList.getAdapter().getView(position,null,null),position,myList.getAdapter().getItemId(position));

here position is your click position

or simply you can do this

mList.getAdapter().getView(position, null, null).performClick();

这篇关于如何在列表视图Android的执行列表项autoclick的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆