tags:

views:

93

answers:

1

Hi Friends,

I am using grid view for displaying image using xml parsing,i got some exception like java.lang.IllegalArgumentException: Illegal character in path at index 80: http://www.theblacksheeponline.com/party_img/thumbspps/912big_361999096_Flicking Off Douchebag.jpg,how to solve this problem?,i want to display all kind of url,anybody knows please give sample code for me..

Thanks All

+5  A: 

URL encoding is done in the same way on android as in Java SE;

try {
    String url = "http://www.example.com/?id=123&art=abc";
    String encodedurl = URLEncoder.encode(url,"UTF-8");
    Log.d("TEST", encodedurl);
} catch (UnsupportedEncodingException e) {
    e.printStackTrace();
} 
Cpt.Ohlund
@http://www.theblacksheeponline.com/party_img/thumbspps/12390867930_15951_186997180114_709920114_4296270_6115611_n[1].jpgHow can i encode this kind of url?please give sample code for me..
sivaraj