There is a webview application, when inserting a link with the symbol "&" it writes an error. With such actions in other source applications, errors do not occur. How to solve? Link can not be replaced

  • What kind of mistake? Why did you decide that it arises because of this symbol? - Android Android
  • Try replacing with & amp; If this helps, then replace all html entities, because there are other characters that can cause an error. - ilyaplot
  • @AndroidAndroid, android studio allocates it as an error, and does not allow to compile apk - user210886
  • @ilyaplot, and this will not affect the contents of the links? - user210886
  • No, entities must be converted back automatically. The error also arises because entities are transformed, but are not them. - ilyaplot

1 answer 1

Try using character escapes for the link:

String strURL = "https://test.com/api/v1?param=1&param=2"; strURL = Uri.encode(strURL);