Android : Why onGlobalLayout() is always called while anim.setCurrentPlayTime() was setted?

on Tuesday, July 29, 2014


I got a ObservableScrollView written like this ObservableScrollView.java and the layout was written like this layout. Also the MainActivity.java was looked like this.


However, I got a problem as I setted a ValueAnimator for the the "sticky" textview and call setCurrentPlayTime() on onScrollChanged() at my MainActivity, the onGlobalLayout() will be called infinitely as the app was launched, even if I didn't scroll the ObservableScrollView. It will be OK if I comment setCurrentPlayTime().


Is there any way I can do to avoid this?


0 comments:

Post a Comment