how to url encode in android?

前端 未结 8 743
盖世英雄少女心
盖世英雄少女心 2020-12-05 10:59

I am using grid view for displaying image using xml parsing,i got some exception like

java.lang.IllegalArgumentException: Illegal character in path a

8条回答
  •  青春惊慌失措
    2020-12-05 11:44

    Also you can use this

    private static final String ALLOWED_URI_CHARS = "@#&=*+-_.,:!?()/~'%";
    String urlEncoded = Uri.encode(path, ALLOWED_URI_CHARS);
    

    it's the most simple method

提交回复
热议问题