samedi 22 août 2020

How can we load a URL after a base URL loaded in webView

It is my first test with webViwe.

When i run a base URL ="https://baseUrl.com" in web browser it load and then URL will change to "https://baseUrl.com/login" like this :

Step one :

enter image description here

Step two:

enter image description here

But when i load "https://baseUrl.com" or "https://baseUrl.com/login" in mobile webView i just faced with step one and it never goes to step two.

This is my codes :

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    webView.settings.javaScriptEnabled = true
    webView.settings.loadWithOverviewMode = true
    webView.settings.useWideViewPort = true

    webView.webViewClient = WebViewClient()

    webView.loadUrl("https://baseUrl/login")

}



Aucun commentaire:

Enregistrer un commentaire