Code example for WebView

Methods: getScalesaveState, getScrollX, getScrollY, getWidth, hashCode, savePicture

0
                data.mTitle = data.mUrl;
            } 
        } 
        // We want to display the top window in the tab picker but use the url 
        // and title of the main window. 
        final WebView w = t.getTopWindow();
        data.mWidth = w.getWidth();
        data.mScale = w.getScale();
        data.mScrollX = w.getScrollX();
        data.mScrollY = w.getScrollY();
        t.mPickerData = data;
    } 
     
    /** 
     * Clean up the data for all tabs. 
     */ 
    /* package */ void wipeAllPickerData() { 
        int size = getTabCount();
        for (int i = 0; i < size; i++) {
            final Tab t = getTab(i);
            if (t != null && t.mSavedState == null) {
                t.mPickerData = null;
            } 
            if (t.mMainView != null) {
                // Clear the picture listeners. 
                t.mMainView.setPictureListener(null);
                if (t.mSubView != null) {
                    t.mSubView.setPictureListener(null);
                } 
            } 
        } 
    } 
 
    /* 
     * Save the state for an individual tab. 
     */ 
    private boolean saveState(Tab t) {
        if (t != null) {
            final WebView w = t.mMainView;
            // If the WebView is null it means we ran low on memory and we 
            // already stored the saved state in mSavedState. 
            if (w == null) {
                return true; 
            } 
            final Bundle b = new Bundle();
            final WebBackForwardList list = w.saveState(b);
            if (list != null) {
                final File f = new File(mThumbnailDir, w.hashCode()
                        + "_pic.save"); 
                if (w.savePicture(b, f)) {
                    b.putString(CURRPICTURE, f.getPath());
                } 
            }