将图像从链接上传到图库

时间:2018-01-16 10:34:53

标签: android android-studio bitmap android-asynctask imageview

我正在尝试将图片从链接下载到图库

此代码无效

RxVolley.download(FileUtils.getSDCardPath() + "/Wallpaper/" + System.currentTimeMillis() + ".png"
                        , "http://......"
                        , new ProgressListener() {
                            @Override
                            public void onProgress(long transferredBytes, long totalSize) {

                            }
                        }, new HttpCallback() {
                            @Override
                            public void onSuccess(String t) {
                                Toast.makeText(context, "下载成功", Toast.LENGTH_SHORT).show();
                            }

                            @Override
                            public void onFailure(VolleyError error) {
                                Toast.makeText(context, "下载失败", Toast.LENGTH_SHORT).show();
                            }
                        });

还有其他代码如asycn任务等...,我希望能帮助我

0 个答案:

没有答案
相关问题