Android URL Decode decodeUrl(String s)

Here you can find the source of decodeUrl(String s)

Description

decode Url

Declaration

public static Bundle decodeUrl(String s) 

Method Source Code

//package com.java2s;
import java.io.UnsupportedEncodingException;

import java.net.URLDecoder;

import android.os.Bundle;

public class Main {
    public static Bundle decodeUrl(String s) {
        Bundle params = new Bundle();

        try {//from   ww  w.  ja v  a2  s . c  o  m

            if (s != null) {
                String array[] = s.split("&");
                for (String parameter : array) {
                    String v[] = parameter.split("=");
                    params.putString(URLDecoder.decode(v[0], "UTF-8"),
                            URLDecoder.decode(v[1], "UTF-8"));
                }
            }

        } catch (UnsupportedEncodingException e) {
        }

        return params;
    }
}

Related

  1. decodeUri(Context ctx, Uri selectedImage)
  2. urlDecode(String in)
  3. decode(final String content, final String encoding)
  4. decode(String s)
  5. decodeUrl(String s)
  6. decodeUrlFormEncoded(String data)
  7. parseForHTTP(String str)
  8. parseLastfmUrl(String url)
  9. parseUrl(String url)