Blankj / AndroidUtilCode

:fire: Android developers should collect the following utils(updating).
https://blankj.com/2016/07/31/android-utils-code/
Apache License 2.0
33.32k stars 10.69k forks source link

File.Utils moveFile() do not moving the file #343

Closed tabish075 closed 6 years ago

tabish075 commented 6 years ago
public void onAction(int requestCode, @NonNull ArrayList<AlbumFile> result) {
                        ToastUtils.showShort(result.get(0).getPath());
                        String s = result.get(0).getPath();
                        String e = Environment.getExternalStorageDirectory().toString();
                        File file = new File(e + "/" + "AAA");
                        if (!file.exists()) {
                            file.mkdirs();
                        }
                        FileUtils.moveFile(s, file.getPath(), new FileUtils.OnReplaceListener() {
                            @Override
                            public boolean onReplace() {

                                ToastUtils.showShort("Done");
                                return false;
                            }
                        });
                    }

Here is what im doing

Blankj commented 6 years ago

U can debug it to see how it works.

tabish075 commented 6 years ago

Thanks for replying, i was using this to move media files.. Actually the files were moving just fine but thumbnails were not deleting from gallery that was the confusion Great Library BTW 👍