Issue
I want to move a file from the android internal storage app-specific directory.
e.g:
from /data/user/0/com.app.package/cache
to /data/user/0/com.app.package/files
I know I can copy all content and do stuff like reading bits, copy the content, re-write it to the new location and then delete the original one.
BUT
I don't want to do this, it's not moving but copying stuff.
So, does anyone knows here any simple method?
Solution
try to move with this code
File from = new File(oldPathWithFileName);
File to = new File(newPathWithFileName);
from.renameTo(to);
this should work only if both files are placed in same storage (thats your case), won't work when you want to move from e.g. internal storage to SD
Answered By - snachmsm
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.