问题
i have a file in the asset folder, and when i press a button in my program i have to move that file in a sub-folder(run-time). Can it be done?
i have to do this: assets/file.txt -> assets/aaa/file.txt
回答1:
No your assets are compiled into your apk file. Consider storing a persistent preference marking whatever you are trying to do instead.
回答2:
No, you can't do it. You can't write anything inside the assets folder programmatically. Better option is to use internal storage. You can use Files Folder in the internal storage. See getFilesDir() in the docs.
回答3:
Reason: Once you have an .apk file it is read only, so you can't add, delete or modify in it,
Alternate: though you can use the sqlite DB for the purpose... where you can save file in hierarchy using blob type and you can modify it through queries...
来源:https://stackoverflow.com/questions/9361288/can-i-move-a-file-in-an-asset-folder-to-an-asset-sub-folder