event handler for holding a list item

by kingkung » Mon, 12 May 2008 22:10:32 GMT


Sponsored Links
 There is the onListItemClick() function for handling item clicks in a
list activity.

How do you handle events which should occur when a person presses and
holds down a list item for >2 secs or so?  There must be a way to
handle these events, since the Contacts application does so (holding
down something in a list will bring up a popup menu of choices).

Anyone have any idea?  Thanks.
--~--~---------~--~----~------------~-------~--~----~



event handler for holding a list item

by Mark Murphy » Mon, 12 May 2008 22:16:59 GMT


 > How do you handle events which should occur when a person presses and

That would be AdapterView#setOnItemLongClickListener().

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
The Busy Coder's Guide to Android Development -- coming in June 2008!


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


event handler for holding a list item

by kingkung » Tue, 13 May 2008 18:29:02 GMT


 Thanks!



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Can anyone know how to setup an application to eeepc based on android?

I've successful running android on my eeepc, but i cannot install any
app on it.
When I install an apk file, it says "Parse error, there is a problem
parsing the package."

Thanks
Kevon
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. AppWidget bitmaps disappear after a few minutes

Hello, I thought this one was funny until it kept me up for 5 hours
last night trying to beat the ADC deadline!

I have an appwidget with an image view in a linear layout. I set the
bitmap to be the icon of an application:

Drawable d = packageManager.getActivityIcon( new ComponentName
(  appPackage, appClass ) );

Bitmap foo = Bitmap.createBitmap
(                          draw.getIntrinsicHeight(),
draw.getIntrinsicWidth(),
                                Bitmap.Config.ARGB_8888
                );
                Canvas can = new Canvas(foo);
                draw.draw(can);
                return foo;

views.setImageViewBitmap( R.id.icon, qq );


--~--~---------~--~----~------------~-------~--~----~

3. what wrong with web source.android.com

4. eglGetCurrentSurface(EGL10.EGL_DRAW)

5. Wrap Text at Word Boundaries

6. custom background color on listview

7. error 404 comes up when tried to browse the site