I have 3 different WebViews embedded in TabViews. How can I refresh the WebView I am leaving when I switch to a different tab? Thanks.
Asked
Active
Viewed 1,577 times
0
-
Did you have a look at http://stackoverflow.com/questions/2563325/is-there-a-better-way-to-refresh-webview ? First hit on Google. – Codemonkey Mar 02 '11 at 07:46
-
Yes, but is there a way to refresh selected WebViews if certain tabs are selected. Like if tab1 is selected I want to refresh webviews 2 and 3, but not webview 1 because thats the tab I am going to and I do not want to wait for loading. – Nick Nelson Mar 02 '11 at 16:11
3 Answers
0
You have to reload activity when you switch to the webView tab. It will reload the webview and the issue would be solved. just add this flag to the tabspec activity declaration: .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).

Vivienne Fosh
- 1,751
- 17
- 24
0
use the OnTabChangeListener and then reload your webview on the hook.

Nathan Schwermann
- 31,285
- 16
- 80
- 91
0
Thanks guys I figured it out by using if("TAB_1".equals(tabId)) { // code here }

Nick Nelson
- 1,131
- 2
- 18
- 36