Browse Button required?

前端 未结 3 570
心在旅途
心在旅途 2020-12-14 12:16

Hii i am working on an application in which i require to select files using browse button.. How can i implement a browse button in android?

3条回答
  •  悲哀的现实
    2020-12-14 12:41

    You need to do:

    1. Create a button which runs a separate activity(startActivityForResult).

    2. This file choosing activity should list all the files and folders from a particular location. If you click on a folder, then activity is reinitialized for this folder(list the files from this).

    3. If a file clicked, then activity should set the result, passing the filename in extras, and finish.

提交回复
热议问题