Skip to content Skip to sidebar Skip to footer

Inject Motion Event Via Windowmanger?

i want to simulate touch event . I am using this code MotionEvent.PointerCoords[] coords = { new MotionEvent.PointerCoords() }; coords[0].x = 200; coords[0].y = 200; int[] ptrs =

Solution 1:

This error: I received an error message . "Cannot make a static reference to the non-static method getSystemService(String) from the type Context" is your problem.

You need to get a reference to the context. Either the application context or the activity.

once you have a Context instance, you can call the .getSystemService method on it.

Post a Comment for "Inject Motion Event Via Windowmanger?"