app/src/main/java/org/weibeld/nytexplore/activity/DetailActivity.java
@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (event.getAction() == KeyEvent.ACTION_DOWN) {
            switch (keyCode) {
                case KeyEvent.KEYCODE_BACK:
                    if (b.webView.canGoBack()) {
                        b.webView.goBack();
                    } else {
                        finish();
                    }
                    return true;
            }

        }
        return super.onKeyDown(keyCode, event);
    }
// Change the device back button to a back button of the embedded web browser
Change the device back button to a back button of the embedded web browser
Change the device back button to a back button of the embedded web browser
@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (event.getAction() == KeyEvent.ACTION_DOWN) {
            switch (keyCode) {
                case KeyEvent.KEYCODE_BACK:
                    if (b.webView.canGoBack()) {
                        b.webView.goBack();
                    } else {
                        finish();
                    }
                    return true;
            }
        }
        return super.onKeyDown(keyCode, event);
    }
@ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { if ( event . getAction ( ) == KeyEvent . ACTION_DOWN ) { switch ( keyCode ) { case KeyEvent . KEYCODE_BACK : if ( b . webView . canGoBack ( ) ) { b . webView . goBack ( ) ; } else { finish ( ) ; } return true ; } } return super . onKeyDown ( keyCode , event ) ; }
Change the device back button to a back button of the embedded web browser
Change the device back button to a back button of the embedded web browser