Doubt back button when opening webview browser

Asked

Viewed 162 times

0

Good afternoon I have the following doubt I use a shouldOverrideUrlLoading to detect when certain link is clicked inside my webview for firing in android browser, Is there any way that opening this link in the browser will create a back button that goes back to webview? Because this link only serves to make a validation and soon after the user must return to webview

[code] mWebView.setWebViewClient(new Webviewclient(){ @Override public Boolean shouldOverrideUrlLoading(Webview view, String url) { if (Uri.parse(url).getHost().equals("www.sitemercado.com.br/valida")) { Return true;

        }
        String valida = "https://www.sitemercado.com.br/valida";
        Intent i = new Intent(Intent.ACTION_VIEW);
        i.setData(Uri.parse(valida));
        startActivity(i);
        Toast.makeText(getApplicationContext(), "1Detectou", Toast.LENGTH_SHORT).show();

        return false;
    }
}); [/code]

1 answer

1

Good morning, In an application (using Webview) that made a download in the browser, I used the code below to return to the App when pressed the back button, it would be this?

@Override public void onBackPressed() { if (wv.canGoBack()) wv.goBack(); Else super.onBackPressed();

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.