[android-developers] Question about long pressed

2009-06-14 Thread patpat
nomrally press a key will cause a keydown event however, when i long pressed a key, it keep causeing keydown events every few sec.. how can i fix this? I only want one keydown event no matter how long it is pressed is there anyway to do this?? --~--~-~--~~~---

[android-developers] How to know how long the key is pressed?

2009-06-13 Thread patpat
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 - pr

[android-developers] How to draw a circle ?

2009-06-09 Thread patpat
I am new and here is my code.. when i ran it ...there was nothing...i expected there should be a circle appear.. can anyone tell me why?? package game.balance; import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup.LayoutParams; import android.widget.LinearLayout;