Code example for WebView

Methods: saveState

0
        // the default implementation requires each view to have an id. As the 
        // browser handles the state itself and it doesn't use id for the views, 
        // don't call the default implementation. Otherwise it will trigger the 
        // warning like this, "couldn't save which view has focus because the  
        // focused view XXX has no id". 
        mWebView.saveState(outState);
    } 
 
    @Override 
    protected void onStop() { 
        super.onStop(); 
         
        CookieSyncManager.getInstance().stopSync(); 
        mWebView.stopLoading();       
    } 
     
    @Override 
    protected void onDestroy() { 
        super.onDestroy(); 
        mWebView.destroy();
    }