Xamarin : Show Toast

sapan
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)
        {
            base.OnCreate(savedInstanceState);
           
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            Toast.MakeText(this, "hello world ", ToastLength.Long).Show();
        }
    }
}
=========================================

Post a Comment

0Comments
Post a Comment (0)

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

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