I am using the method
srcPath = await CrossFilePicker.Current.PickFile();
from the package Xamarin.Plugin.FilePicker. This works fine and I can select a file on my device. Afterwards I want to give the user a feedback via
await UserDialogs.Instance.AlertAsync(message);
However, on Android Samsung SM-T805, the dialog message is blocked.
It seems to me that the FilePicker is not fully closed. When the PickFile() method is reached two windows appear: A dark one titled Android and, after confirming the access to external storage, the actual file picker. Once I've chosen a file the file picker disappears and my further code is executed. But the background layer (dark, titled Android) does not disappear until I leave the Xamarin.Forms.Command method, which I linked to a button triggering the file picking method.
My code (roughly):
[...]
using Xamarin.Forms;
using Plugin.FilePicker;
using Acr.UserDialogs;
namespace SomeNameSpace
{
public class SomeViewModel
{
[...]
public Command ImportCommand => new Command(() => ChooseFile());
private async void ChooseFile()
{
string srcPath = await CrossFilePicker.Current.PickFile();
await UserDialogs.Instance.AlertAsync("Help Me Please.");
// Further Code
[...]
}
}
}
Any ideas? Thanks in advance!