7

I have an android webview that displays generated content with loadDataWithBaseURL. Looks great. However, if i follow a link and then hit the back button I get a blank page where I'd like to see my generated content.

does anyone know how I can use the back button to return to my generated content?

4

1 に答える 1

0

これを試して:

mWebView.setOnKeyListener(new OnKeyListener() {
    public boolean onKey(View v, int keyCode, KeyEvent event) {
        switch(keyCode)
        {
            case KeyEvent.KEYCODE_BACK:
                if(mWebView.canGoBack() == true){
                    mWebView.goBack();
                    return true;
                } else
                    return false;   
                }

                return false;
            }
        });
于 2012-11-12T20:29:13.407 に答える