How to call ItemClickListener
programmatically? listView.performItemClick()
does not work. Is that possible?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
If you need it for testing purposes, then you can use Robotium ( http://code.google.com/p/robotium/ ).
You could also achieve what you want by calling the
onClick
method of theClickController
with the correct parameters.You can set up an
onItemClick
listener for your list view viaAssign tag in the adapter to each
View
, andfindviewByTag()
this worked for me:Also refer this answer.
If you want to click/tap/select 3rd list item then.
This worked perfectly for me.
The answer is
listView1.performItemClick(listView1, 3, listView1.getItemIdAtPosition(3));
from the link
http://mantascode.com/?p=486
Where mActivePosition is your click position!