Questions tagged [onitemclick]

OnItemClick is a callback method invoked when an item in an Android AdapterView has been clicked.

268 questions
2
votes
2 answers

Android onItemClick giving Incorrect id

I am trying to get the details for a clicked item in a ListView by querying the SQLite database. I am passing the long id value from onItemClick as the primary key. However, the long id does not match with the actual primary key in the Table. I…
user2348956
  • 71
  • 2
  • 7
2
votes
1 answer

Get wrong id onItemClick

I try to use ListView with two ImageVies. First is some photo and second delete photo button. I try to handle wich item I click but always get same id that different from both of ImageViews. I also try to do this in Adapter class, but found that is…
Anton A.
  • 1,407
  • 11
  • 32
2
votes
1 answer

what is parent and view in onItemClick?

I have a difficulty in understanding following method. In the documentation, the method description is as follows: public abstract void onItemClick (AdapterView parent, View view, int position, long id) Parameters: parent The AdapterView…
xyz
  • 1,273
  • 5
  • 23
  • 44
2
votes
3 answers

ListView onItemClickListener does not work Android

Ive seen plenty of posts, plenty of tutorials but i can't find the key to make this work. I have a listView with friend requests,as u see these requests have 2 buttons (accept or deny) and i want to know how can i know which button is clicked (At…
2
votes
1 answer

ListFragment onItemClick

I am using import android.support.v4.app.ListFragment to create a ListFragment. Inside the fragment itself -- not the parent activity -- I want to implement the onItemClick method. Will someone please provide a simple example on how this might…
Katedral Pillon
  • 14,266
  • 20
  • 87
  • 182
2
votes
3 answers

How to get ListView data from one activity to another using setOnClickListener

In my listview there are to feilds,ward number and the date.i want to get these data to new activity when i'am clicking a listview.but in this there is a runtime error and i have no idea to how to fix it. this is my dashboardActivity.java…
user2881604
  • 2,030
  • 3
  • 18
  • 35
2
votes
2 answers

Android ListView trouble with OnItemClick Listener

My app is a list of firms, each firm is a row in my listview that shows: picture, name and phone (by adapter). Everything is working! But when I click in a item of my listview, it should start another activity that shows page with firm details. I'm…
2
votes
1 answer

I have a ViewPager which contains multiple ListViews, where do I listen for an item being clicked?

I have an activity which contains classes for my list adapter and my view pager adapter as well as your standard activity functions. The result is the ability to swipe through multiple lists. I'm not sure where to listen for an item click. In the…
benwiz
  • 1,567
  • 17
  • 28
2
votes
5 answers

implementing OnItemClickListener, but onItemClick doesn't work

In MainActivity there is onItemClick, and the activity iplements OnItemClickListener. all is very simple, the result of this listener is to print with a Toas a message on screen when an user touch an item of the ListView. But the onItemClick…
tune
  • 23
  • 2
  • 5
2
votes
4 answers

ListView Custom OnItemClickListener not being called

Okay I have been tearing my hair out for the past couple hours here trying to figure out why my custom listview adapter cannot work properly with OnItemClickListener. I have a TextView where I use the DrawableLeft attribute to draw an image to the…
Brosa
  • 1,129
  • 8
  • 19
2
votes
1 answer

ListView PerformItemClick not working

This question has been asked a lot of times and I've systematically gone through each and tried to find which version of performItemClick works. Unfortunately I just can't get any of them to work despite my onclick method being called. I have a…
AndroidPenguin
  • 3,435
  • 2
  • 18
  • 40
2
votes
2 answers

How to ignore the click made in row of a listview

Scenario : I have n number of tabs each tab is having its own listview. I am using a Array adapter to generate a listview. The array which is passed to arrayadaper is having array of objects. Each object has a "menu" and "menu type" . Now based on…
user1822729
  • 815
  • 1
  • 13
  • 26
2
votes
1 answer

Using onItemClickListener after changing from ArrayList<> to SimpleCursorAdapter

I'm still wrapping my head around ContentProviders, Loaders and SimpleCursorAdapters (I found it easier with the old startManagingCursor method). Essentially, I have a ListView activity, that when a list item is clicked, would open a new activity…
2
votes
4 answers

Using multiple onItemClick's in one activity.. "Duplicate method" error?

I've made a list of artists, that once clicked bring up a list of albums. The idea is that once an album is clicked, the list of songs comes up. Unfortunately, because there are two listviews being generated in this activity, the second…
user1352742
1
vote
2 answers

Listview click is not fire.

I created custom adapter for listview which contain text and images, on click of particular list item I have to open another activity, but I am not able to fire listview click event, below is my code. Thanks. Adapter public class…
Ishtiaq
  • 1,166
  • 8
  • 18
1 2
3
17 18