Code example for Method

Methods: setAccessibleinvoke

  public void scrollTo(int x, int y) {
    try { 
      Method method = View.class.getDeclaredMethod("onScrollChanged", new Class[] {int.class, int.class, int.class, int.class});
      method.invoke(realView, x, y, scrollToCoordinates.x, scrollToCoordinates.y);
    } catch (Exception e) {
      throw new RuntimeException(e);
    scrollToCoordinates = new Point(x, y);
  public int getScrollX() { 
    return scrollToCoordinates != null ? scrollToCoordinates.x : 0;
  public int getScrollY() { 
Connect your IDE to all the code out there  Get Codota for Java