[android-developers] Long Click on ListActivity item

2010-10-16 Thread Simone
I'll be brief. I have a ListActivity that uses a custom Adapter implementing BaseAdapter. When I perform a click on an object, the method ListActivity.onListItemClick() gets executed. Is there a way to execute a different portion of code when I perform a LONG click on an item? Thanks, Simone --

Re: [android-developers] Long Click on ListActivity item

2010-10-16 Thread Kumar Bibek
When you long click on a list item, the method onItemLongClick should be called. If you want your own listener, you cannot do that on the stock listview. Extend and create your own list view and configure a separate lintener for that. On Sat, Oct 16, 2010 at 2:39 PM, Simone

Re: [android-developers] Long Click on ListActivity item

2010-10-16 Thread Kostya Vasilyev
Simone, If the purpose of handling long-clicks is to display a context menu for list items, you can use this: yourActivity.registerForContextMenu(yourListViewReference) If it's actually the long click you want, you can set a listener for it: