質問

How can I implement a method in a separate thread that performs the transfer of files between folders on Android, and after transferring this file to be deleted from the source folder?

役に立ちましたか?

解決

Some hints:

  1. You can use AsyncTask to do something on a separate thread.
  2. Think whether you wil be dealing with files in internal or external storage. If latter, you'll need to specify a permission in your manifest file.
  3. A simple way of moving a file to a new location:

    File file = new File(filename);

    boolean success = file.renameTo(new File(newName));

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top