Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Created March 1, 2018 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/21ac1f75c5c0119bd34afd0a8cfbdeb7 to your computer and use it in GitHub Desktop.
Save juucustodio/21ac1f75c5c0119bd34afd0a8cfbdeb7 to your computer and use it in GitHub Desktop.
This example show native messages to users in Xamarin.Forms applications - http://julianocustodio.com/native-message
using Android.App;
using Android.Widget;
using DemoNativeMessage.Droid;
[assembly: Xamarin.Forms.Dependency(typeof(MessageAndroid))]
namespace DemoNativeMessage.Droid
{
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();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment