We released an android APP several years ago, and there's a View.setVisibility() method used in a sub thread. It has been no problem in these years until Android O Developer Preview 4. When I test our APP on Android O Developer Preview 4, I found View.setVisibility() in a sub thread will throw a exception as follows:
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
I've moved this method to main thread and fixed this problem.
But my questions are:
Why is no exception thrown in previous versions(even no exception in Android O Developer Preview 1)?
What change in Android O leads to this problem? We should explain it to our customer but we can't find the proof on Android developer's website.