2

How to refresh the webview which is called from Android tabview after once called, for example if i called an activity that is connected with the tabview then it does not refreshes once its called. Is there any way to do that,,

Code:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    TabHost tabHost = getTabHost(); 

    tabHost.addTab(createTab1(aActivity.class, "a", "", R.drawable.ic_tab_a));
    tabHost.addTab(createTab2(bActivity.class, "b", "", R.drawable.ic_tab_b));
    tabHost.addTab(createTab3(cActivity.class, "c", "", R.drawable.ic_tab_c));  
    tabHost.setCurrentTab(0);
}
James Mitchee
  • 143
  • 5
  • 16

1 Answers1

1
Call again

mWebView.loadUrl("http://www.websitehere.php");

so the full code would be

newButton.setOnClickListener(new View.OnClickListener() {

  public void onClick(View v) {
dgeActivity.this.mWebView.loadUrl("http://www.websitehere.php");
  }});

I found this answer on stack overflow.And it should work for sure.

or try this one

Implement a WebViewClient, overriding shouldOverrideUrlLoading() to tell Android what you want to do on link clicks. Attach that WebViewClient to the WebView via setWebViewClient().

Tofeeq Ahmad
  • 11,935
  • 4
  • 61
  • 87