j wrote: > I launch my TestWebView activity. After my web page is loaded, I put > the app in the background by pressing the Home key. Then I bring the > TestWebActivity back to the foreground. Unexpectedly, TestWebView's > onCreate() is called when I bring the activity to the foreground. But > onDestroy is never called. This same thing happens every time I > tested. It appears the old TestWebView was not completely killed so > there are possibly duplicate web clients running.
Ummmm...I'm not seeing this in one of my WebView test projects. Visit http://commonsware.com/AdvAndroid, download the source code, and look at WebView/GeoWeb1. I just put a Log.w() call in onCreate() and things behaved as expected: I got the onCreate() when I first fired up the app, but when I clicked on Home, then clicked on the app again in the launcher, my existing instance popped right back up and I did not get a second onCreate() call. If I back-arrow out of the app and then relaunch it, I do get another onCreate(). Now, I'm not using setWebChromeClient() or a few of your other options, so it's conceivable that somehow changes matters. And you didn't post your manifest, so there might be something in there that impacts matters. But I'd start with some other WebView-using code (either mine or an API sample or something) and see if it gives you the same behavior. Assuming its onCreate() is not being fired multiple times, start tracking down the differences between your app and the working code. If you can narrow down the source of your difficulty, or if I misunderstood the pattern you used to cause the problem, let us know! -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

