Toast in android using xamarin forms

 

When we want to let user know that something happening we can use Toast.

Let’s see how to create Toast in in Android in Xamarin Forms

Create xamrin foms application with Android project

project

  • In .net standard project add a Interface

https://gist.github.com/jeevan90/35286d1d05475f9b2a4dfa082d83b62f

  • In Android project add ToastMessageService and implement the IToastMessageService

https://gist.github.com/jeevan90/5295db3704ec837d11fc2b92e680e691

  • In MainPage.xaml add a button

https://gist.github.com/jeevan90/f87dab536f6886f356e550d164d9755b

  • And in the code behind implement the event handler

https://gist.github.com/jeevan90/9318cbc660c8321554451a9905ae0d96

Finally run the project 🙂

 

toast

Get the sample project on Github

One thought on “Toast in android using xamarin forms

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s