This is the code I run. In the simulator the code runs. But on the device as soon as I hide the app the code pauses and the Task.Delay is never done and the second Clipboard set as well.
await Clipboard.SetTextAsync(text);
await Task.Delay(5000,_cancellationTokenSource.Token);
await Clipboard.SetTextAsync(string.Empty);
How could I execute this code when then user has switched to a different application?