'Kotlin Responsive webview not working, used a bunch of settings but it's not turning into a responsive webview

    private lateinit var binding: ActivityMainBinding

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)


        val mWebView = binding.webview1
        mWebView.loadUrl("https://hotels.cloudbeds.com/")

        val webSettings = mWebView.settings

        mWebView.settings.useWideViewPort = true
        mWebView.settings.loadWithOverviewMode = true
        webSettings.javaScriptEnabled = true
        webSettings.domStorageEnabled = true
        webSettings.allowContentAccess = true
        mWebView.webViewClient = WebViewClient()

        mWebView.canGoBack()
        mWebView.setOnKeyListener(View.OnKeyListener { v, keyCode, event ->
            if (keyCode == KeyEvent.KEYCODE_BACK

                && event.action == MotionEvent.ACTION_UP
                && mWebView.canGoBack()){
                mWebView.goBack()
                return@OnKeyListener true
            }
            false
        })
    }
}

The photos always go sideways like this no matter what settings I use, it always overflows to the right

I'm trying to make the website fit into the screen, what settings should I use? And I've tried most



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source