문제

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