I have an app I've been using for more than five years. It's basically a database of comics site's web addresses that I can scroll through and display in a web view. In addition to the comic each page also displays a ton of ads from the comic's website. I've used this app on 4 or 5 different tablets, from different manufacturers, using different versions of Android (currently Android 11 on a Samsung).
Sometimes I will make it through the entire database with no pages locking up.
Randomly when a page is being displayed, the WebView will lock up – the page doesn't finish loading, and I can no longer load other pages by tapping Prev or Next.
When the web view locks up, if I exit the app, using the back button, then restart the app, the web view will remain locked up. If I wait a long amount of time before restarting the app (sometimes 15 minutes, sometimes more than an hour), it will work again. I attribute this to Android finally killing my app when it feels like it after period of time.
If I exit the app, using the back button, go into settings and Force Stop the app, then reopen the app, the web view will display pages properly.
My best guess at what's happening is that pages sometimes try to display an ad or an ad from a source that causes the web view to go into an infinite loop. Killing the app also kills that instance of the web view and the infinite loop is killed.
Doing a Google search finds many people with problems of WebViews freezing, but no solutions and few details.
Is there a way to reset the WebView? I've tried StopLoading, but that doesn't seem to work. I can also see resetting the WebView might interfere with the way B4A initializes it.
Can I force a ForceStop when I close the app? There is really no reason to keep the app running in the background and if it locks up, a Force Stop will save me from having to navigate through settings.
Any other suggestions?
Thanks,
Barry.
Sometimes I will make it through the entire database with no pages locking up.
Randomly when a page is being displayed, the WebView will lock up – the page doesn't finish loading, and I can no longer load other pages by tapping Prev or Next.
When the web view locks up, if I exit the app, using the back button, then restart the app, the web view will remain locked up. If I wait a long amount of time before restarting the app (sometimes 15 minutes, sometimes more than an hour), it will work again. I attribute this to Android finally killing my app when it feels like it after period of time.
If I exit the app, using the back button, go into settings and Force Stop the app, then reopen the app, the web view will display pages properly.
My best guess at what's happening is that pages sometimes try to display an ad or an ad from a source that causes the web view to go into an infinite loop. Killing the app also kills that instance of the web view and the infinite loop is killed.
Doing a Google search finds many people with problems of WebViews freezing, but no solutions and few details.
Is there a way to reset the WebView? I've tried StopLoading, but that doesn't seem to work. I can also see resetting the WebView might interfere with the way B4A initializes it.
Can I force a ForceStop when I close the app? There is really no reason to keep the app running in the background and if it locks up, a Force Stop will save me from having to navigate through settings.
Any other suggestions?
Thanks,
Barry.