Folder Picker for Android

Hi,

I'm trying to make a folder picker for Android using an Interface. I need to use an Interface with the DependecyService in my pcl application. I have succeded to open the folder picker, but I don't know how to get the selected path.
This is the code I'm trying to use :

    Intent intent = new Intent(Intent.ActionOpenDocumentTree);
        intent.SetFlags(ActivityFlags.NewTask);
        Application.Context.StartActivity(intent);

I don't know if this can be the correct solution
Thanks for any help.

Answers

  • Sahadev_GuptaSahadev_Gupta INMember ✭✭✭

    @JulienTorrent After the Picker Dialog box appear choose the specific directory you want. After you choose it.

    On MainActivity.cs file this method is called

    protected async override void OnActivityResult(int requestCode, Result resultCode, Intent data)

    you can get the selected directory path from the data

Sign In or Register to comment.