2017-05-22 36 views
0

我想在外部庫(Android中的AppCompat)中記錄一個變量值。如何在java中記錄庫變量?

有沒有可能?我知道我可以打一個斷點,檢查值,但我想查多觸摸事件的回調,這都很難有這樣

例如調試,代碼爲:

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並註銷curOffsetnewOffset

+2

請提供具體的細節。 –

回答

0

你可以通過你有興趣,然後在斷點處單擊鼠標右鍵,取消Suspend選項,並在Evaluate and log與填充線設置斷點在IDEA做到這一點類似Log.d(TAG, debugMessage)

相關問題