0

Im creating client/server app and I want to send motion event performed on scroll view on client side to server side, and perform it on the same scroll view.

I have no problems sending motion event over TCP connection, but having problem performing that motion event on same scroll view on server side.

How do I programmatically perform motion event on scroll view? Help.

Veljko
  • 1,893
  • 6
  • 28
  • 58

1 Answers1

1

Use the method public void scrollTo(int x, int y) on the ScrollView .

bluefalcon
  • 4,225
  • 1
  • 32
  • 41
  • That is not what I need... There is a big difference between performing motion on scrollView and performing .scrollBy on the same... – Veljko Sep 08 '11 at 14:42
  • my bad, you were looking for the motion event? The thing is you cannot do this since it is part of a security feature in android as mentioned in this [post](http://stackoverflow.com/questions/5240287/how-to-send-synthesized-motionevent-through-the-system/5240821#5240821). Hope it helps! – bluefalcon Sep 08 '11 at 14:57
  • But I don`t want to perform system event... ScrollView a = (ScrollView)findViewById..... MotionEvent motion = MotionEvent.obtain(.... a.performMotionEvent(motion) Problem is that there is no method performMotionEvent. :( I think for this, there are no security problems... Right? – Veljko Sep 08 '11 at 15:10
  • there shouldn't have been, since you can do a click on a view programmatically. Guess you ll have to find an another way around.. – bluefalcon Sep 08 '11 at 16:58