android user agent

前端 未结 5 895
旧巷少年郎
旧巷少年郎 2020-11-30 01:22

I am writing an app in Android that uses a WebView to display HTML content. I was told to get an Android user agent for my app - how do I do that? I opened http://whatsmyuse

5条回答
  •  庸人自扰
    2020-11-30 01:37

    After much research, I figured it out. There is a way to set a user agent for Android WebView.

    webview.getSettings().setUserAgentString("user-agent-string");
    

    http://developer.android.com/reference/android/webkit/WebSettings.html

提交回复
热议问题