Why this code not works?
The following works well.
I solved. The problem was that I called this function on onUrlChanged event. I put it to onLoadingFinished. Now it works well.