Android Java - 它不会创建和保存两个专辑

时间:2015-05-30 18:48:46

标签: java android

我说我有问题。 1.无法为图片的URL创建已保存的相册。 代码中是否有错误,我仍然不明白,我很高兴你伸手。

private void downloadImage() {
    if (future != null) {
        //set the callback and start downloading
        future.withResponse().setCallback(new FutureCallback<Response<InputStream>>() {
            @Override
            public void onCompleted(Exception e, Response<InputStream> result) {
                boolean success = false;
                if (e == null && result != null && result.getResult() != null) {
                    try {
                        //prepare the file name
                        String url = mSelectedImage.getUrl();
                        String fileName = url.substring(url.lastIndexOf('/') + 1, url.length()) + ".jpg";
                        //create a temporary directory within the cache folder
                        File dir = Utils.getAlbumStorageDir("wall-splash");
                        //create the file
                        File file = new File(dir, fileName);
                        if (!file.exists()) {
                            file.createNewFile();
                        }

                        //copy the image onto this file
                        Utils.copyInputStreamToFile(result.getResult(), file);

                        //animate the first elements
                        animateCompleteFirst(true);

                        success = true;
                    } catch (Exception ex) {
                        Log.e("un:splash", ex.toString());
                    }

                    //animate after complete
                    animateComplete(success);
                } else {
                    animateReset(true);
                }
            }
        });
    }
}

错误(Android Studio) 05-30 21:40:40.297 3608-4157/com.mikepenz.unsplash.debug E/art﹕ dlopen("/data/app/com.mikepenz.unsplash.debug-2/lib/arm/libgmscore.so", RTLD_LAZY) failed: dlopen failed: library "/data/app/com.mikepenz.unsplash.debug-2/lib/arm/libgmscore.so" not found 05-30 21:40:40.297 3608-4157/com.mikepenz.unsplash.debug E/ProviderInstaller﹕ Unable to load native code from /data/app/com.mikepenz.unsplash.debug-2/lib/arm/libgmscore.so 05-30 21:40:40.317 3608-4157/com.mikepenz.unsplash.debug E/ProviderInstaller﹕ libgmscore version mismatch (0 vs. 7571) 05-30 21:53:32.082 3608-3608/com.mikepenz.unsplash.debug I/wall-splash﹕ Directory not created

0 个答案:

没有答案