Hi,
My problem is that I created a toast that works fine, but unfortunately, toasts are not very polite, and don't not wait until the current shown toast will
finish its job. It just moves it away.
I can solve it in an ugly way, which means to put Task.Delay() before the second toast (in order to let the first toast to finish its job).
I wondered if there is a better way.
This is how I created the toast.
1. I created an interface in Xamarin Forms:
public interface IMessage
{
void LongAlert(string message);
void ShortAlert(string message);
}
In Android Project I wrote the implementation:
public class MessageAndroid : IMessage
{
public void LongAlert(string message)
{
Toast.MakeText(Application.Context,message, ToastLength.Long).Show();
}public void ShortAlert(string message) { Toast.MakeText(Application.Context, message, ToastLength.Short).Show(); }
}