This is the way I have to show the Toast for 500 milliseconds. Though, it\'s showing more than a second.
Toast.makeText(LiveChat.this, \"Typing\
I have created a class ToastMessage in droid side.
public class ToastMessage: IToast
{
public void LongAlert(string message)
{
Toast toast = Toast.MakeText(Android.App.Application.Context, message, ToastLength.Short);
toast.Show();
Device.StartTimer(TimeSpan.FromSeconds(0.5), () =>
{
toast.Cancel();
return false;
});
}
}
I have created interface IToast
public interface IToast
{
void LongAlert(string message);
}
Calling By Dependency Service
DependencyService.Get().LongAlert("Right Answer");