Questions tagged [onitemclick]

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

274 questions
2
votes
2 answers

Connecting an Android ListView onClick to another Activity

I am making a MP3 player Android App. I want to start another activity from a ListView click that opens up the artist directory to show the songs from that one artist. I based my code off of the [Android tutorial][1]. This below is in my onCreate…
2
votes
1 answer

Android ListFragment update/refresh and onItemClick

I´ve a problem in my Android Project. It´s a music track player, which shows each track in a ListFragment. Every item has got a Bitmap, where an oscilloscope is drawn on the bitmaps canvas. The items in the Listfragment are refreshed periodically.…
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
  • 81
  • 2
  • 8
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,718
  • 15
  • 37
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,534
  • 25
  • 99
  • 199
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,330
  • 3
  • 21
  • 38
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
  • 2,167
  • 3
  • 22
  • 33
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
  • 1
  • 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,169
  • 9
  • 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,445
  • 2
  • 21
  • 42
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
  • 825
  • 1
  • 13
  • 27
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 2
3
18 19