How to open desktop site in webview in android

后端 未结 5 1168
暗喜
暗喜 2020-12-20 02:01

I need to open desktop site in android webview for that i have tried as below but it is not working.

String newUA= \"Mozilla/5.0 (X11; U; Linux i686; en-US;          


        
5条回答
  •  一个人的身影
    2020-12-20 02:26

    For Mobile User-Agent

    webview.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U; Android 4.4; en-us; Nexus 4 Build/JOP24G) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30");

    For Desktop site Agent

    browser.getSettings().setUserAgentString("Mozilla/5.0 (Linux; diordnA 7.1.1; suxeN 6 Build/N6F26U; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 eliboM Safari/537.36");

    A lot of searches this code fine working on Android webview.

提交回复
热议问题