Android Question ExternalStorage - Rename a folder.

After selecting a folder - is it possible to rename it?
If this is not possible, then how can I rename a folder in an arbitrary location?
 

agraham

Expert
Licensed User
Longtime User
No guarantees but try this, where AnExternalFile is an ExternalFile returned by FindFile. Result is True if it succeeds
B4X:
Dim NewName as String = "NewName"
Dim result as Boolean
Result = AnExternalFile.Native.RunMethod("renameTo", Array(NewName))
 
Upvote 2

agraham

Expert
Licensed User
Longtime User
Comments for renameTo from the Android API reference for DocumentFile which is what the Native member of ExternalFile is
 
Upvote 0
Thank you very much, I will try to do it.
 
Upvote 0
Works great!
Thanks for the help, it was very important for my Project.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…