I am working on a drawing application. When I touch on screen
primitive is drawing properly but when I am dragging on emulator
screen only few times onTouch event is called.
// mPaint is a Paint object.
        @Override
        public boolean onTouchEvent(MotionEvent event) {
                   float x = event.getX();
                   float y = event.getY();

            switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                        mCanvas.drawBitmap(primitive, x, y, mPaint);
                          touch_start(x, y);
                                  invalidate();
                           break;
                case MotionEvent.ACTION_MOVE:
                        mCanvas.drawBitmap(primitive, x, y,
mPaint);                                                                 
invalidate();
                          break;
                case MotionEvent.ACTION_UP:
                             mCanvas.drawBitmap(primitive, x, y, mPaint);
                                invalidate();
                                break;
                        }
                        return true;
                }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to