Toast in Delegate

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Toast in Delegate

Jason Carter
I'm sure this is something easy, but I can't figure it out.


 private Button _btnContinue;
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.main);
                _btnContinue = (Button)FindViewById(Resource.Id.button);
                _btnContinue.Click += delegate
                {
                    //StartActivity (this, typeof (Login))
                    var t = new Toast(Application.BaseContext) {
Duration = ToastLength.Long };
                    t.SetText(Resource.String.hello);    <<-----ERROR COMES HERE
                    t.Show();
                };
            }
            catch (Exception ex)
            {
                Log.Error("MainActivity", ex.Message);
            }




Best Regards,
Jason Carter

"We can't solve problems by using the same kind of thinking we used
when we created them."  - Albert Einstein
_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Toast in Delegate

Jeffrey Alstadt


What is the Error? Can u step into the Function?


On Apr 23, 2011, at 16:51, Jason Carter <[hidden email]> wrote:

> I'm sure this is something easy, but I can't figure it out.
>
>
> private Button _btnContinue;
>        protected override void OnCreate(Bundle bundle)
>        {
>            try
>            {
>                base.OnCreate(bundle);
>                SetContentView(Resource.Layout.main);
>                _btnContinue = (Button)FindViewById(Resource.Id.button);
>                _btnContinue.Click += delegate
>                {
>                    //StartActivity (this, typeof (Login))
>                    var t = new Toast(Application.BaseContext) {
> Duration = ToastLength.Long };
>                    t.SetText(Resource.String.hello);    <<-----ERROR COMES HERE
>                    t.Show();
>                };
>            }
>            catch (Exception ex)
>            {
>                Log.Error("MainActivity", ex.Message);
>            }
>
>
>
>
> Best Regards,
> Jason Carter
>
> "We can't solve problems by using the same kind of thinking we used
> when we created them."  - Albert Einstein
> _______________________________________________
> Monodroid mailing list
> [hidden email]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Toast in Delegate

Jason Carter
Disregard,  poor usage of Toast.

Best Regards,
Jason Carter
813-516-5861

"We can't solve problems by using the same kind of thinking we used
when we created them."  - Albert Einstein




On Sat, Apr 23, 2011 at 5:09 PM, Jeffrey Alstadt <[hidden email]> wrote:

>
>
> What is the Error? Can u step into the Function?
>
>
> On Apr 23, 2011, at 16:51, Jason Carter <[hidden email]> wrote:
>
>> I'm sure this is something easy, but I can't figure it out.
>>
>>
>> private Button _btnContinue;
>>        protected override void OnCreate(Bundle bundle)
>>        {
>>            try
>>            {
>>                base.OnCreate(bundle);
>>                SetContentView(Resource.Layout.main);
>>                _btnContinue = (Button)FindViewById(Resource.Id.button);
>>                _btnContinue.Click += delegate
>>                {
>>                    //StartActivity (this, typeof (Login))
>>                    var t = new Toast(Application.BaseContext) {
>> Duration = ToastLength.Long };
>>                    t.SetText(Resource.String.hello);    <<-----ERROR COMES HERE
>>                    t.Show();
>>                };
>>            }
>>            catch (Exception ex)
>>            {
>>                Log.Error("MainActivity", ex.Message);
>>            }
>>
>>
>>
>>
>> Best Regards,
>> Jason Carter
>>
>> "We can't solve problems by using the same kind of thinking we used
>> when we created them."  - Albert Einstein
>> _______________________________________________
>> Monodroid mailing list
>> [hidden email]
>>
>> UNSUBSCRIBE INFORMATION:
>> http://lists.ximian.com/mailman/listinfo/monodroid
> _______________________________________________
> Monodroid mailing list
> [hidden email]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Loading...