differentiating single click and long click.

by mmkr » Fri, 19 Feb 2010 02:19:02 GMT


Sponsored Links
 Hi all,
        I have an array list of a view in my application. The view has
both single click and long click
listeners. To detect a particular view that is selected I'm using
isPressed() for single click listener. Now how can I detect that a
particular view is longclicked from the array list of view?

thanks in advance

--



differentiating single click and long click.

by social hub » Fri, 19 Feb 2010 02:36:43 GMT


 can u try using onclickpress() and implement there




>


Sponsored Links


differentiating single click and long click.

by social hub » Fri, 19 Feb 2010 02:37:06 GMT


 sorry meant onlongpress






>>



Other Threads

1. Using GPS in a widget hangs on lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, (float) 0.001, locationListener);



I didn't say that. I said you can't fork threads from a BroadcastReceiver.

App widgets are designed to change either on user input or after a
period of time (preferably something nice and long, like 30 minutes, to
save battery life).

Based on your (non-working) code, you want to have an *app widget* be
updated every time the device moves *a meter*. This would:

-- require GPS to be on 24 hours a day, driving down battery life
tremendously

-- require some service of yours to be in memory all of the time,
reducing the amount of memory available for other things

-- update the home screen, thereby doing inter-process communication, on
every change, further driving down battery life (and, since GPS can
sometimes be twitchy, you might get these updates a whole lot)

I recommend you watch Jeff Sharkey's "Coding for Life...Battery Life,
That Is" presentation from the 2009 Google I/O conference:

http://code.google.com/events/io/2009/sessions/CodingLifeBatteryLife.html

You can create a service that will get woken up by an AlarmManager alarm
periodically, register for location updates, update the app widget when
a fix arrives, and shut down waiting for the next alarm. If you do this
fairly infrequently, battery impact should be modest. However, I have no
idea if this model will meet your needs, since "fairly infrequently" is
a far cry from what your current implementation was trying to do.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

-- 

2. Using GPS in a widget hangs on lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, (float) 0.001, locationListener);

I'm bummed.
So it seems widgets are only useful for once-a-day type info, no
exceptions?








-- 

3. call one activity from Dialog Class

4. D-GPS Enabled Development Phones

5. What is the deal with the android: namespace?

6. how to overcome "permission denied" error when SystemProperties.set

7. Contacts 2.0: How to create a Contact without an Account? ("Unsynched")