1
In the android I have the following URL
String url = "http://domain.com/page?parameter1=value1¶meter2=value2";
I’d like to take the parameters of this URL
how do I do it in a simple way?
1
In the android I have the following URL
String url = "http://domain.com/page?parameter1=value1¶meter2=value2";
I’d like to take the parameters of this URL
how do I do it in a simple way?
3
To do this you can use the class URLEncodedUtils
which is a utilitarian class of android for URL
's
Do it this way:
String url = "http://domain.com/page?parameter1=value1¶meter2=value2";
List<NameValuePair> parameters = URLEncodedUtils.parse(new URI(url),"utf-8");
for (NameValuePair p : parameters) {
System.out.println(p.getName());
System.out.println(p.getValue());
}
Browser other questions tagged java android url
You are not signed in. Login or sign up in order to post.