Android examples for java.net:URL
get Value From Query String by key
import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.net.URLEncoder; import java.security.SecureRandom; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Locale; public class Main{ public static String getValueFromQueryString(String url, String key) { int keyStPos = url.indexOf(key + "=") + key.length() + 1; if (keyStPos == -1) { return ""; }// w w w.jav a 2 s. c om int keyEnPos = url.indexOf("&", keyStPos); if (keyEnPos == -1) { keyEnPos = url.length(); } return url.substring(keyStPos, keyEnPos); } }