How can I reload the webview from static embedded class
<p>I have the following problem.  I have a tabbed application implemented using a ViewPager.  Each tab is a Fragment with nothing but a webview in it.  I have an inner class BroadcastReceiver that catches changes to the internet connection.  What I want to do is reload the webpage when it picks up the fact that the internet has reconnected.  The problem is that the inner class is static and so I can't all non-static methods like mWebView.Reload();  </p>

<p>Is it possible to get around this problem?</p>

<p>Below is the code for the Fragment that contains the webview.  I have 7 different tabs and this class is instantiated all 7 times.</p>

<pre><code>public class MyWebviewFragment extends SherlockFragment
{
final static private String tag = MyWebviewFragment.class.getSimpleName();
String mTabURL;
private WebView mWebView = null;
static final int REFRESH_ID = Menu.FIRST;
private View v;
private int mTabNumber=-1;
private boolean mWebViewLoaded=false;

public static class ConnectionChangeReceiver extends BroadcastReceiver
{
  @Override
  public void onReceive( Context context, Intent intent )
  {
    ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService( Context.CONNECTIVITY_SERVICE );
    NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
    //NetworkInfo mobNetInfo = connectivityManager.getNetworkInfo(     ConnectivityManager.TYPE_MOBILE );
    if ( activeNetInfo != null )
    {
        Toast toast = Toast.makeText(context, R.string.internet_reconnected, Toast.LENGTH_LONG);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();

    }
    else
    {
        Toast toast = Toast.makeText(context, R.string.internet_not_on, Toast.LENGTH_LONG);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }
  }
}

/**
 * When creating, retrieve this instance's number from its arguments.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(tag,"onCreate");

    super.onCreate(savedInstanceState);

    // Tell the framework to try to keep this fragment around
    // during a configuration change.
    setRetainInstance(true);

    if(getArguments() != null)
    {
        mTabURL = getArguments().getString("tabURL");
        mTabNumber = getArguments().getInt("tabNumber");
    }
    Log.i(tag,"***** Exiting onCreate: tab#: " + mTabNumber + " tab URL: " + mTabURL + " *****");
}

/**
 * The Fragment's UI is just a simple text view showing its
 * instance number.
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
    boolean bSavedInstanceStateRestored = false;
    Log.i(tag,"onCreateView " + "tab#: " + mTabNumber);

    // Create view object to return
    v = inflater.inflate(R.layout.webview_layout, container, false);

    // Check to see if it has been saved and restore it if true
    if(savedInstanceState != null)
    {
        Log.i(tag,"savedInstance != null in onCreateView - attempting to restore view");

        if (savedInstanceState.isEmpty())
            Log.i(tag, "Can't restore state because bundle is empty.");
        else
        {
            mWebView = ((WebView)v.findViewById(R.id.webview_fragment));
            if(mWebView.restoreState(savedInstanceState) == null)
            {
                Log.i(tag, "Restoring state FAILED!");
            }
            else
            {
                Log.i(tag, "*!*!*!*!*!*! Restoring state succeeded. *!*!*!*!*!*!");
                initWebView();
                bSavedInstanceStateRestored = true;
            }
        }

    }

    if(!bSavedInstanceStateRestored)
    {
        Log.i(tag,"savedInstance == null in onCreateView - creating new webview");
        // Load web page
        mWebView = (WebView)v.findViewById(R.id.webview_fragment);
        initWebView();
        mWebView.loadUrl(mTabURL);

    }
    Log.i(tag, "***** Exiting onCreateView " + "tab#: " + mTabNumber + " *****");
    return v;
}

void initWebView()
{
    Log.i(tag, "initWebView " + "tab#: " + mTabNumber);

    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.setOnKeyListener(new OnKeyListener(){
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event)
        {
            if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {
                mWebView.goBack();
                return true;
            }
            return false;
        }

    });

    // Used to be in new creation
    mWebView.setWebViewClient(new MyWebViewClient());
    mWebView.getSettings().setBuiltInZoomControls(false);
    mWebView.getSettings().setSupportZoom(false);
    mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    mWebView.getSettings().setAllowFileAccess(true);
    mWebView.getSettings().setDomStorageEnabled(true);

    Log.i(tag, "***** Exit initWebView " + "tab#: " + mTabNumber + " *****");
}
...
</code></pre>

<p>Alternatively, I would like to programmatically change back to the first tab (tab 0) and this would redraw automatically.</p>
