Retrieve User-Agent programmatically

前端 未结 6 1734
天涯浪人
天涯浪人 2020-12-13 17:52

Is there a way to retrieve Browser\'s user-agent without having a WebView in activity?

I know it is possible to get it via WebView:

6条回答
  •  有刺的猬
    2020-12-13 18:28

    Since Android 2.1 you should use System.getProperty("http.agent");

    You also dont need to create a WebView first AND , thats the advantage, you can use it inside a non-uithread.

    greetings steve

提交回复
热议问题