FilePicker.PickAsync(PickOptions.Default) does always fail, how to fix it?
xi guo
40
Reputation points
using Xamarin.Essentials;
already:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
When I try this:
try
{
await FilePicker.PickAsync(PickOptions.Default);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
I receive the exceptions:
The current Activity can not be detected. Ensure that you have called Init in your Activity or Application class
Help!
Thanks!
Sign in to answer