public static void setAttachInfo()

in core/src/main/java/com/facebook/testing/screenshot/WindowAttachment.java [115:129]


  public static void setAttachInfo(View view) {
    if (sAttachInfo == null) {
      sAttachInfo = generateAttachInfo(view);
    }

    try {
      Method dispatch =
          View.class.getDeclaredMethod(
              "dispatchAttachedToWindow", Class.forName("android.view.View$AttachInfo"), int.class);
      dispatch.setAccessible(true);
      dispatch.invoke(view, sAttachInfo, 0);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }