I have an android application that loads web pages in an activity with a WebView. I am using the retrieving the page manually and using WebView\'s loadDataWithBaseUR
I was having the same problem and I tried all answers but nothing helped (tested all of them on Nexus 5 running Marshmallow). loadDataWithBaseURL
solution was not relevant to me as I was using loadUrl
instead.
Now, this isn't a solution but something I luckily noticed. This thing is really weird and only works if the target url ends in .html
. My intention is to help anyone facing this problem as I know how annoying this can be. So please bear with me, please do not down vote this answer if you think this is nonsense.
What I noticed is that if the url ends in .html
, that white screen appears when back button is pressed.
On the other hand, if you remove that .html
from your url - obviously only if this is supported by that website (i.e. the redirection and all is handled properly at the server side and that it doesn't trigger the 404 Page Not Found error), that url will act as your base this time and when you press the back button, that white screen should not appear this time.
for example: you have to replace http://example.com/page.html to: http://example.com/page
Again, I am not posting this without testing thoroughly - this works for me today and am happy that I found this and I hope that it helps you too.