Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can not click on listView

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have focusable items in your rows of your ListView?
 
Piyush Patel
Ranch Hand
Posts: 127
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hardik Trivedi wrote: getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);

Since you have used Choice Mode, Use setOnItemSelectedListener

 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys I am not still clear.

can I post full code?
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, send the code it will be easy to solve your problem.
 
Hardik Trivedi
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
following is the code..



ArrayAdapter works fine.
There is some other problem in setting the listener.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic