I'm trying call a method present in a class that extends AccessibilityService
from another class that extends Service
this way:
MyAccessibility access = new MyAccessibility();
access.doAction(); // doAction(); is the method called
but nothing happens, already if this is called inside MyAccessibility
(AccessibilityService
class) all works fine.
public class MyAccessibility extends AccessibilityService {
@Override
protected void onServiceConnected() {
super.onServiceConnected();
System.out.println("Accessibility was connected!");
doAction();
}
public void doAction(){
performGlobalAction(GLOBAL_ACTION_RECENTS);
}
}
Then how i can call any method of MyAccessibility
from a another service?
EDIT:
I also tried change doAction()
to be static
, but performGlobalAction
cannot be.