how to depress the onLongClick() when drag a view

by sheng wang » Mon, 19 Apr 2010 14:47:24 GMT


Sponsored Links
 Hi,

I have a View and I can drag it. It also has a onLongClick() method so it
can respond to the long press on the screen.

The problem is when I drag it , the onLongClick will also be triggered .
Anyone have an idea to depress the long click detection when i move it .


Thanks in advances.
Shawn.

--



how to depress the onLongClick() when drag a view

by grace » Mon, 19 Apr 2010 16:28:42 GMT


 hi,

try disabling the longclick event using public void setLongClickable
(boolean longClickable)
function  while ur performing the drag operation and enable it after
that..
so that u can have both the functionalities..

regards,
Grace.



>


Sponsored Links


how to depress the onLongClick() when drag a view

by grace » Mon, 19 Apr 2010 16:30:44 GMT


 hi,

try disabling the longClick event using  public void setLongClickable
(boolean longClickable)
function while ur performing the drag operation and enable it after
that..
so that u can have both the functionalities..


Regards,
Grace.



>



Other Threads

1. CPU cost of a semi-infinite loop

Hi,

I'm working on a metronome application, so I need a rather accurate
time-measuring system to fire the metronome sound at the right time.
Actually I found a solution, but I'm wondering if my method will not
be cpu consuming. Here is the code snippet :

     t = new Thread() {
        public void run() {

          long neededTime = 0;
          while(isRunning){

            long curTime = SystemClock.uptimeMillis();

            if(curTime>=neededTime){

              neededTime = curTime + (60000/tempo);
              playSound(clickSoundId,100);

              incrementBeat();

              mHandler.post(mUpdateUi);
            }
          }
        }
    };
    t.setDaemon(true);
    t.start();

You can see I set up a semi-infinite loop with rather frequent
accesses to uptimeMillis() . I chose this method after having some
issues with sleep() which is not accurate enough. When I want to stop
the metronome, I just have to set isRunning to false.

How can I evaluate the impact of this on CPU and battery ?

Thanks a lot.
Rgds, Alex

-- 

2. Start default email client

Hi at all,

How can I make a intent to start the default email client?
I would like to set the receiver address of message..

Thanks!

-- 

3. Need Android Service suggestions

4. can not find draw9patch.jar after updating to 2.3

5. Prevent user from removing accounts

6. Problem while loading phone contacts in ascending order

7. Does camera of emulator support digital zoom?