Toasting my way ?

StrangerweatherStrangerweather GBMember ✭✭
edited June 2016 in Xamarin.Android

Hi! I have a custom toast xml file ready, but I can't seem to connect it to my existing code. This is what I have so far:

`private void RadioButtonClick(object sender, EventArgs e)
{
View view = LayoutInflater.Inflate(Resource.Drawable.custom_toast, null);
var design = view.FindViewById(Resource.Id.my_custom_toast);

        RadioButton rb = (RadioButton)sender;

        string toast = string.Format("{0}", rb.Text);


        var customToast = new Toast(this)
        {
            View = view
        };
        Toast.MakeText(this, rb.Text, ToastLength.Long).Show();

        if (toast == "French")
        {
            tts.SetLanguage(Locale.French);
        }

}`

If anyone has any idea what I could be doing wrong, I would be grateful to be told! Cheers! :-)

Tagged:
Sign In or Register to comment.