我想在外部库中记录变量值(android中的AppCompat)。
有可能吗?我知道我可以点击一个断点并检查一个值,但是我想检查一下很难以这种方式调试的触摸事件回调
例如,代码是:
int setHeaderTopBottomOffset(CoordinatorLayout parent, V header, int newOffset,
int minOffset, int maxOffset) {
final int curOffset = getTopAndBottomOffset();
int consumed = 0;
if (minOffset != 0 && curOffset >= minOffset && curOffset <= maxOffset) {
// If we have some scrolling range, and we're currently within the min and max
// offsets, calculate a new offset
newOffset = MathUtils.constrain(newOffset, minOffset, maxOffset);
if (curOffset != newOffset) {
setTopAndBottomOffset(newOffset);
// Update how much dy we have consumed
consumed = curOffset - newOffset;
}
}
return consumed;
}
我希望在curOffset != newOffset
时记录案例并注销curOffset
和newOffset
答案 0 :(得分:0)
您可以在IDEA中通过在您感兴趣的行上设置断点来执行此操作,然后右键单击断点,取消选中Suspend
选项并使用{{1}填写Evaluate and log
}}