File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Android and the fly likes Can not click on listView Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Can not click on listView" Watch "Can not click on listView" New topic

Can not click on listView

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252

I am facing a strange problem.I made a custom array Adapter which displays thing in list view.This works fine but when I click on list items. I am not able to click them.

The following is a bit of a code which I did for that.

Sorry I am not giving the full code,because it will become clumsy.

please help..
Senthil Ganesan

Joined: Jul 29, 2010
Posts: 16
hi try to use setOnItemClickListener event
for example---

dgame.setOnItemClickListener(new OnItemClickListener() {

public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {

Monu Tripathi

Joined: Oct 12, 2008
Posts: 1369

Do you have focusable items in your rows of your ListView?

[List of FAQs] | [Android FAQ] | [Samuh Varta]
Piyush Patel
Ranch Hand

Joined: Feb 24, 2009
Posts: 127

Hardik Trivedi wrote: getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);

Since you have used Choice Mode, Use setOnItemSelectedListener

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
hey guys I am not still clear.

can I post full code?
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 632

yes, send the code it will be easy to solve your problem.

Life is easy because we write the source code.....
Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
following is the code..

ArrayAdapter works fine.
There is some other problem in setting the listener.
I agree. Here's the link:
subject: Can not click on listView
It's not a secret anymore!