AppMsg.Sample.MainActivity.OnCreate C# (CSharp) Method

OnCreate() protected method

protected OnCreate ( Bundle bundle ) : void
bundle Bundle
return void
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            FindViewById<Button>(Resource.Id.btnAlert).Click += (e, s) =>
            {
                Msg.MakeText(this, "Alert 测试", Msg.STYLE_ALERT).Show();
            };

            FindViewById<Button>(Resource.Id.btnConfirm).Click += (e, s) =>
            {
                Msg.MakeText(this, "Confirm 测试", Msg.STYLE_CONFIRM).Show();
            };

            FindViewById<Button>(Resource.Id.btnInfo).Click += (e, s) =>
            {
                Msg.MakeText(this, "Info 测试", Msg.STYLE_INFO).Show();
            };

            FindViewById<Button>(Resource.Id.btnOpen).Click += (e, s) =>
            {
                if (appmsg == null)
                {
                    appmsg = Msg.MakeText(this, "不会自动关闭的提示", new Sino.Droid.AppMsg.Style(Msg.LENGTH_STICKY, Color.White, Color.Yellow));
                }
                if (!appmsg.IsShowing)
                {
                    appmsg.Show();
                }
            };

            FindViewById<Button>(Resource.Id.btnClose).Click += (e, s) =>
            {
                if (appmsg != null)
                {
                    appmsg.Dismiss();
                }
            };
        }
    }
MainActivity