URL.decode无法使用字符串

时间:2018-07-19 15:01:04

标签: android

我有一个带有URL的图像,需要将其放入imageview,所以我尝试使用URL.decode以获得正确的路径,因为在调试模式下,我的URL为:

"url":"https:\/\/cdn2.careerinsights.tv\/wpcontent\/uploads\/2014\/06\/capgemini-logo.jpg"}]}

但是我仍然没有得到想要的结果

这是我的模特:

public class Folder {
    public String dossierImage;
    public Folder(){}
    public String getDossierImage() throws UnsupportedEncodingException{
    return URLDecoder.decode(dossierImage, "UTF-8");;
    }
    public void setDossierImage(String dossierImage) {
        this.dossierImage = dossierImage;
    }
}

这是我打电话的地方:

try {
    Picasso.get().load(s.getDossierImage()).into(dossierImage, new Callback() {
        @Override
        public void onSuccess() {
            Log.e(TAG, "onSuccess()");
        }

        @Override
        public void onError(Exception e) {
            Log.e(TAG, "Picasso error!!");
        }
    });
} catch (UnsupportedEncodingException e) {
    e.printStackTrace();
}

0 个答案:

没有答案