Xamarin : Show Toast

After creating the hello world app with xamarin. I decided to start with some basic stuff.
I decided to show a Toast very simple yes.

Well to show a simple toast it took me almost half an hour figure out why it is not working.
The problem was with IDE. After re-starting the IDE it start working.

namespace androidtest1
    [Activity(Label = "androidtest1", MainLauncher = true)]
    public class MainActivity : Activity
        Context context;
        protected override void OnCreate(Bundle savedInstanceState)
            // Set our view from the "main" layout resource
            Toast.MakeText(this, "hello world ", ToastLength.Long).Show();

Post a Comment

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !