This kind of stuff:
On Fri, Apr 22, 2011 at 6:33 PM, Sunil Lakhiyani <
[email protected]> wrote:
> // on touch event code i got from some site..
> @Override
> public boolean onTouchEvent(MotionEvent event)
> {
>
> if(event.getAction() == MotionEvent.ACTION_UP &&
> rightSideDrawable!=null)
> {
> rectangleBounds = rightSideDrawable.getBounds();
> final int x = (int)event.getX();
> final int y = (int)event.getY();
>
> if(x>=(this.getRight()-rectangleBounds.width()) &&
> x<=(this.getRight()-this.getPaddingRight())
> && y>=this.getPaddingTop() &&
> y<=(this.getHeight()-this.getPaddingBottom()))
> {
> this.setText("");
> event.setAction(MotionEvent.ACTION_CANCEL);//use this to
> prevent the keyboard from coming up
>
(Modifying the motion event)
Is the kind of thing that causes apps to break on different platforms or
devices. It is not at all defined what it means to suddenly modify the
motion event like that. Just because it happens to do something that you
like doesn't mean it will always do this.
--
Dianne Hackborn
Android framework engineer
[email protected]
Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.
--
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