How to detect the user touch and hold the screen for touch screen devices?

Hello

I want my code to do the following:

when user touch and hold on the screen{
    myThread.start();
}

when user release the finger on the screen{
    myThread.done();  //a method to stop the thread
}

Any ideas? Thank you very much

Never to change never return super.touchEvent (...) to return true (well, you can do it for complete events such as MOVE or GESTURE. SWIPE_...) -you will disrupt the event processing complex (just about everything, but downwards and upwards).

The code works for me (I do something else, with more visual impact, so I know for sure that it does). One thing, try - check the status of your Thread (isAlive()) before you start, as DOWN seems to be generated twice.

If you could be more specific with what "won't work" is, I would be able to help more.

Tags: BlackBerry Developers

Similar Questions

  • How to detect the screen off the power of the event

    Is it possible to detect the screen off the power of the event?  I am looking to detect when the screen turns off due to time-out or press the button of the lock screen.  Similarly, I would need to detect where the screen turns back on.  I searched through the API WebWorks and forums but have not found anything relevant.  Maybe I'm looking just the wrong thing. Any help would be appreciated.

    Hi deedubbu,

    I'm certainly not an Expert in Java BB so it might be a good idea to post something on these forums, but a quick search on Google, it seems that you should be able to encapsulate event

    In Exchange for my Google search, I humbly request post you the result on our community API github repo

  • How to detect the resize for TextInput event?

    I have a grid, a textInput field, sometimes the text field is too long, I need to truncate. The size of the textinput could be modified by the action of the user column size. I would like to call function truncate happens when resizing. I tried adding "resize = myfunction (event)" in the textinput defintion, but seems that the function is not called.

    Any suggestion /.

    Thanks in advance

    When TextInput comes in memory 1st time then resize function is called as well later change in the size of it. TextInput is getting resized or not. Is that your function is like this?

    public void resizeTextInput(event:_ResizeEvent):void

    {

    ///

    }

  • How to limit the bandwidth for each different devices connected to my router

    Hello

    Thanks in advance!

    Can you help me to limit bandwidth on perticular devices, I use NETGEAR (WNR1000v2 - N150 wireless router) and the version of the firmware of the V1.1.2.58, like almost 4 devices are connected to this router, I want to limit the speed of bandwidth to each device.

    I have not found the Qos in my Netgear.

    It might help if you provided in details with screenshots.

    Thank you

    Samira

    Not possible with this model of router

  • How to detect the window closing event and to do some tasks before leaving

    Hello

    Someone knows how to detect the window closing event and to do some tasks before leaving?

    Sridhar

    Structure of the event allows to detect the window closing event. In the structure of the event,.

    Select this VI-> close round table for this task. See attached picture.

  • How to activate the screen of welcome and fast user switch client services for netware

    How to activate the screen of welcome and fast user switch client Services for NetWare...

    How to restore and step to uninstall client services for netware

    Hello

    Your question of Windows is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the public on the TechNet site. Please post your question in the below link: http://social.technet.microsoft.com/Forums/en-US/winserverPN

  • How to detach the screen from the keyboard, and how do I use the touch screen without stylus?

    I have a gateway M285 ta6 t2300 clocked at 1.6 ghz dual core 1 GB 40 GB combo windows 7 tablet laptop 2-1 d. I don't have a pen for the touchscreen, but because I bought it used... I would like to know if I can use the touch screen using my fingers or do I have to buy a pen and if so what kind? Also, I would like to know how to detach the screen from the keyboard.

    Hello

    I suggest that you go to the Gateway Web site and download a manual for the model that will show you how to use it.

    Gateway:

    http://us.gateway.com/GW/en/us/content/drivers-downloads

    See you soon.

  • How to detect the key ALT pressed in os7

    Hai,

    How to detect the key ALT pressed in Os7...

    Can I use the source for os 7 as below? ,

    protected boolean keyStatus (int keycode final, time final int) {}

    If (Keypad.key (keycode) == Keypad.KEY_ALT) {}

    ...

    Returns true;

    } else

    Return super.keyStatus (keycode, time);

    }

    and also I want to know which is the return of this method? In detail
    How to detect the other touches also?
    What are the updations or changes in the code, on os6 os7?

    KeyCode is a bit model, if you use "is" to compare you won't get accurate results, you should use the operator '& '.

    See
    http://supportforums.BlackBerry.com/T5/Java-development/detect-ALT-and-shift-key-clicks/Ta-p/444976

  • How to detect the sign of a number?

    I output which gives the number of negative or positive. My problem is how to detect the sign of the Boolean number and output? For example if the input number is negative as - 23.11 I want to output the value false and if the number is positive as 17.99 I want to output true.

    T H A N K S!

    Test if the number is greater than or equal zero.

  • I forgot my password for my admin user account, but I have a secondary account how to get the password for the admin

    original title: admin password.

    I forgot my password for my admin user account, but I have a secondary account how to get the password for the admin

    Hello
    Microsoft technical support engineers cannot help you recover the passwords of the files and Microsoft who are lost or forgotten product features. For more information about this policy, please refer to the sticky below.

    http://social.answers.Microsoft.com/forums/en-us/vistasecurity/thread/3eba3150-8742-4264-be9f-0daaad2282cd Lisa
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to detect the number of created quickobjects

    How to detect the number of quickobjects created? quickobject are quickbox2d.

    Basically, I have a timer that will countdown to 4 seconds and it will create a falling ball, it will get removed when she falls down. However, I want only there so that if more than 5 bullets are in step, it will cease to create until it is less than 5 to start creating some balls again. Is there a way I can do?

    It's the timer to create the ball

    If (! _ballCreation_timer) {}

    _ballCreation_timer = new timer (4000);

    _ballCreation_timer.addEventListener (TimerEvent.TIMER, _onBallCreationTimer);

    }

    _ballCreation_timer. Start();

    Function which create the ball based on clock

    function _onBallCreationTimer (e:TimerEvent): void {}

    _doCreateNewBall();

    }

    function _doCreateNewBall() {}

    _ball_quickobject = sim.addCircle ({x: PHYSICS_SCALE * (960), y: PHYSICS_SCALE * (10), RADIUS: 0.5, draggable: false});

    MAKE A LIST OF BALLS

    _balls_array.push (_ball_quickobject);

    }

    This is the part where if the table (QuickObject) ball falls down and are destroyed

    addEventListener (Event.ENTER_FRAME, _onEnterFrame);

    DRAW EACH BALL FALLING OUT OF THE SCREEN

    function _onEnterFrame (aEvent: Event): void {}

    for each (var quickObject: QuickObject in _balls_array) {}

    BALL FALLING OUT OF THE SCREEN?

    If (quickObject.y / PHYSICS_SCALE > 1080) {}

    _doHandleBallOffScreen (quickObject);

    }

    }

    }

    DESTROY THE BALL FALL OFF THE SCREEN IF

    function _doHandleBallOffScreen (aQuickObject: QuickObject): void {}

    DESTROY THE OBJECT

    aQuickObject.destroy ();

    REMOVE FROM THE CUSTOM TABLE

    _balls_array.splice (_balls_array.indexOf (aQuickObject), 1);

    }

    check the length of _balls_array.  If it is greater than 5, do not create another bullet:

    If (! _ballCreation_timer) {}

    _ballCreation_timer = new timer (4000);

    _ballCreation_timer.addEventListener (IMER TimerEvent.T, _onBallCreationTimer);

    }

    _ballCreation_timer. Start();

    Function which create the ball based on clock

    function _onBallCreationTimer (e:TimerEvent): void {}

    _doCreateNewBall();

    }

    function _doCreateNewBall() {}

    If (_balls_array.length<>

    _ball_quickobject = sim.addCircle ({x: PHYSICS_SCALE * (960), y: PHYSICS_SCALE * (10), RADIUS: 0.5, draggable: false});

    MAKE A LIST OF BALLS

    _balls_array.push (_ball_quickobject);

    }

    }

    This is the part where if the table (QuickObject) ball falls down and are destroyed

    addEventListener (Event.ENTER_FRAME, _onEnterFrame);

    DRAW EACH BALL FALLING OUT OF THE SCREEN

    function _onEnterFrame (aEvent: Event): void {}

    for each (var quickObject: QuickObject in _balls_array) {}

    BALL FALLING OUT OF THE SCREEN?

    If (quickObject.y / PHYSICS_SCALE > 1080) {}

    _doHandleBallOffScreen (quickObject);

    }

    }

    }

    DESTROY THE BALL FALL OFF THE SCREEN IF

    function _doHandleBallOffScreen (aQuickObject: QuickObject): void {}

    DESTROY THE OBJECT

    aQuickObject.destroy ();

    REMOVE FROM THE CUSTOM TABLE

    _balls_array.splice (_balls_array.indexOf (aQuickObject), 1);

    }

  • How to detect the color pages in a PDF file?

    I use a plug-in of Acrobat C++ read/modify a PDF file.

    I need to get the total number of pages in the PDF file and the page numbers of the pages in color.

    So far, I was able to get the total number of pages using PDDocGetNumPages() with no problems.

    However, I can't find an API that lets me know if a particular page is color or not. Is there a way to do this?

    Thanks in advance!

    But what happens if there are RGB data which means black or grey (R == G == B), that means black or RGB?

    There is a code sample in the SDK to browse content in the PDF file, and then you can get the color space and color of each object.

    But you really need to do background research on the colors & spaces to achieve this properly.

    From: Sachintha81 [email protected]<>[email protected]>

    Reply-To: "[email protected]<>[email protected]> ' [email protected]<>[email protected]>" "

    Date: Wednesday, February 8, 2012 16:57:10-0800

    To: Leonard Rosenthol [email protected]<>[email protected]>

    Topic: How to detect the color pages in a PDF file?

    Re: How to detect the color pages in a PDF file?

    created by Sachintha81http://forums.adobe.com/people/Sachintha81> in Acrobat SDK - see the discussion complete onhttp://forums.adobe.com/message/4194889#4194889

  • How to set the clock for the hours, minutes, and seconds with Windows XP

    How to set the clock for the hours, minutes, and seconds with Windows XP

    I don't know of your question.  If you ask how to show the clock in the tray system with hours, minutes and seconds, then download & run "Tclock Light".  Windows will not natively display the seconds.

    TClock Light: <> http://homepage1.nifty.com/kazubon/tclocklight/index.html >

    HTH,
    JW

  • How to change the password for the user name in the Oracle forum

    I wanted to know how to change the password for my user in the Oracle forum. I couldn't find the navigation to do.

    Ask for a response to my post.

    Concerning

    Date of arrival:

    Getting help: frequently asked Questions

    About your Oracle account

  • How to change the country for the invoicing and purchasing?

    How to change the country for billing and for purchasing ?

    Hi Adriano.

    Visit it change the country associated with your Adobe ID

    I hope this will help. Please write if you need assistance most.

    Kind regards

    Shelly

  • How to calibrate the screens of Adobe products? For the most part, I'll use Illustrator and Photoshop.Can someone make a difference between the calibration and the Hardware calibration software using (Spider)? Thank you.

    How to calibrate the screens of Adobe products? I will mostly use Illustrator and Photoshop.Can make all the difference between calibration and the Hardware calibration software using (Spider)? Thank you.

    I use U2415 from Dell.

    I use the Spyder Pro 4. The process is quite simple - install the software, plug the Spyder and follow the steps listed in the program. I would recommend also, install the latest version of the software directly from the site of Datacolor instead to install from the disc supplied (probably outdated).

    Benjamin

Maybe you are looking for

  • display iPad problem

    Files for "cutting" in bottom of screen background photo. Now, they are all solid gray.  Is there a display setting that I forgot?

  • Home Kit is just the voice commands?

    So, just to confirm my interpretation of this...  Kit home of Apple is mainly for use SIRI.  This isn't an app that brings together all your smart house equipment. Fix?  It's just for voice commands?  Not looking forward to a folder and by jumping in

  • Install Vista Ultimate on a new disc

    Hello world I have Vista Ultimate installed on my 320 GB internal hard drive. The Vista disc that I have, cannot be installed on a pc. Unfortunately, this disc has become unstable and I'm afraid it will fail and I will lose everything on it. I am abo

  • V2.1.0 WebWorks SDK and API file

    Hello First of all thanks for the update with the new APIs. I need a clarification on the queue API. The link to the API file for playbook below shows some examples. http://www.BlackBerry.com/developers/docs/WebWorks/API/BlackBerry.IO.file.html It is

  • 8 GB of RAM shows that only 2.85 GB usable

    Dear team My 32-bit Windows 7 system shows only 2.85 GB usable out of 8 GB of RAM in the system properties. Is there a problem with my PC. Help, please.