Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Can not click on listView" Watch "Can not click on listView" New topic
Author

Can not click on listView

Hardik Trivedi
Ranch Hand

Joined: Jan 30, 2010
Posts: 252
Hi,

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
Greenhorn

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
Rancher

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


[My Blog] [ Follow @Twitter] | Innovations never goes out of Style...
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: 629

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: http://aspose.com/file-tools
 
subject: Can not click on listView
 
Similar Threads
webview help......
Problems with listview and checkbox event
how to add multiple frames
How to get View from customised ListView?
what it the best from ListActivity andActivity