Overriding onDraw for ViewPager sometimes gives black screen
问题 I extended ViewPager to have a moving background (seems to be a fairly popular request too) It seems to be mostly working, the problem I have is that sometimes the whole background turns black. This actually specifically occurs when I rotate the screen while on another page than the first one and start moving (it is still ok after the screen rotation) - when the activity restarts after the screen rotation, it restores the ViewPager to the same page as it was before. The whole code with