Here you can find the source of getUrlQueryParameters(final String url)
Parameter | Description |
---|---|
url | a parameter |
public static final Bundle getUrlQueryParameters(final String url)
//package com.java2s; import java.net.URLDecoder; import android.os.Bundle; public class Main { /**//from www . j av a 2 s. com * * @param url * @return bundle that contains key-value entries of the url query. */ public static final Bundle getUrlQueryParameters(final String url) { final Bundle bundle = new Bundle(); final String[] separated = url.split("\\?"); if (separated.length > 1) { final String query = separated[1]; final String[] params = query.split("&"); for (final String param : params) { final String[] keyvalue = param.split("="); final String key = URLDecoder.decode(keyvalue[0]); String value = null; if (keyvalue.length > 1) { value = URLDecoder.decode(keyvalue[1]); } bundle.putString(key, value); } } return bundle; } }