0
0

WebViewでUserAgentを設定する

Posted at

はじめに

今回はWebView内の通信でUserAgentをカスタマイズする方法を紹介していきます

本文

webViewClient.settings.userAgentStringで取得と上書きをすることができます。
そのため、下記のようにするとhogeのみが登録されてしまうので、上書きをしたくないのであれば、取得したものを追加で入れる必要があります

webViewClient.settings.userAgentString = "hoge"

最後に

今回はretrofitではなく、WebViewでの設定方法を紹介しました
どなたかのお役に立てればさいわいです

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0