How to set Backpressed botton in android studio

 let us know how to set backpressed in android application

you can set in WebView and other online application.

code is here.



@Override

    public void onBackPressed() {


        WebView webView = findViewById(R.id.webv);

        if (webView.canGoBack()){

            webView.goBack();

        }

        else {

            super.onBackPressed();

        }





Comments

Popular posts from this blog

How to add clear button in android Studio.

how to set WebView in android studio