here is my code public boolean onKeyUp(int keyCode, KeyEvent event) { Message m = new Message(); m.what = theGamev2.REDRAW;
switch(keyCode) { case KeyEvent.KEYCODE_DPAD_CENTER: releaseTime = System.currentTimeMillis(); this.mBall.createNewCircle(pointerCurrentXCoord, 30, ((int) (releaseTime - pressTime))/10); break; default: return super.onKeyDown(keyCode, event); } this.mBallUpdateHandler.sendMessage(m); return true; } public boolean onKeyDown(int keyCode, KeyEvent event) { Message m = new Message(); m.what = theGamev2.POINTER; switch(keyCode){ case KeyEvent.KEYCODE_DPAD_CENTER: pressTime = System.currentTimeMillis(); break; default: return super.onKeyDown(keyCode, event); } this.mBallUpdateHandler.sendMessage(m); return true; } i am using system time here to get the difference....but it doesnt work like the way i want.. i wonder is there method or concept to know how long the key is pressed?? Please give me an example if u have a way to do it...Thanks a lot. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---