Click here to Skip to main content
12,817,112 members (34,699 online)
Rate this:
Please Sign up or sign in to vote.
See more: Java Mobile Android
I need to separate click and double click(for remote control), for example when I touch surface, timers starts, wheh I touch again timer stops and calculates difference between touches in milliseconds. I googled, but found a large and hard code. Please, help..
Posted 6-Feb-13 7:00am
Richard MacCutchan 6-Feb-13 12:47pm
Why not show what you have done up to now, and explain which parts you are having difficulty with.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Please check this Blog,m that should explain the thingy:[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

If you want the easy way to know the time for the client between to double click .
You don't need to start a timer .
Just do like this
you will get what you want.
public class MainActivity extends Activity {
	private long fristTime = -1;
	protected void onCreate(Bundle savedInstanceState) {
		findViewById( OnClickListener() {
			public void onClick(View v) {
					Log.d("Print","double click between frist click to  second click in milliseconds is : "+(System.currentTimeMillis()-fristTime)); 
					fristTime = -1;
					fristTime = System.currentTimeMillis();




by the way.
find a job in New York.
I have 3 year Experience about andorid.
And have few Experience about game server
in MS 2005 server C++.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100