K
K
Kuhejuzaca2016-12-03 07:25:37
Java
Kuhejuzaca, 2016-12-03 07:25:37

How to properly encode URL in Android?

String url = " site.ru/search?q= " + URLEncoder.encode(search.getText().toString(), "UTF-8");
This code throws an UnsupportedEncodingException error. What's wrong here? URLEncoder.encode( "urlParameterString", java.nio.charset.StandardCharsets.UTF_8.toString()); also used, does not work, same thing.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rou1997, 2016-12-03
@Rou1997

https://www.google.ru/search?newwindow=1&q=android...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question