Using myObject.performClick() I can simulate click event from the code.
Does something like this exist for onTouch event? Can I mimic touch action from the Java code?
EDIT
This is my onTouch listener.
myObject.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
// do something
return false;
}
});
This should work, found here: How to simulate a touch event in Android?:
For more on obtaining a MotionEvent object, here is an excellent answer: Android: How to create a MotionEvent?
EDIT: and to get the location of your view, for the
xandycoordinates, use: