的WebView建立内存的Android [英] Webview building up the memory Android
问题描述
在我的混合动力车Android应用程序,在的ListView
项目点击我加载一个的WebView
通过将<与URL code>的WebView 活动,以显示其中。用户可以通过单击后退按钮回到先前视图。
In my hybrid Android application, on a ListView
item click I'm loading a WebView
by passing the WebView
activity with the url to display in it. The user can come back to the earlier view by clicking back button.
但正在发生的事情是点击3-4 的ListView
项目后,该应用程序变得缓慢,我认为这是因为的WebView
活动是一次又一次的重新分配不加载它。
But what is happening is after clicking on 3-4 ListView
items, the app is becoming slow, which I think is because WebView
activity is loaded again and again without deallocating it.
任何人都可以帮我在这方面?
Can anybody please help me in this context?
推荐答案
在网页视图活动的onDestroy()破坏的WebView为好。 myWebView.destroy();
In the onDestroy() of the webview activity destroy the WebView as well. myWebView.destroy();
这篇关于的WebView建立内存的Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!