Thursday, May 12, 2011

upload web image

Drawable d1;
        d1= LoadImageFromWebOperations(profileinage);
        profileimage.setBackgroundDrawable(d1);


function:

private Drawable LoadImageFromWebOperations(String url) {
   
   
    try {
        InputStream is = (InputStream) new URL(url).getContent();
        Drawable d = Drawable.createFromStream(is, "srcname");
        return d;
    } catch (Exception e) {
        System.out.println("Exc=" + e);
        return null;
    }

No comments:

Post a Comment