Hi,

Could you try placing the breakpoint inside the OnCreate method and testing
if it stops there? A second test would be to break up the button.Click line
like this:

button.Click += delegate {
     button.Text = string.Format("{0} clicks!", count++);
};

and place a breakpoint inside the delegate, on the "button.Text" line. That
should get hit when you click the button on the app.

On Tue, Aug 2, 2011 at 4:57 PM, Chocolade <bou...@bezeqint.net> wrote:

> I installed anroid sdk tools to c:\Anroid
> Then i installed mono on my visual studio 2010 pro. And i have windows 7.
>
> Now i selected to create new mono for anroid project: Mono for android
> application
> And then im getting this automatic code:
>
> using System;
>
> using Android.App;
> using Android.Content;
> using Android.Runtime;
> using Android.Views;
> using Android.Widget;
> using Android.OS;
>
> namespace MonoAndroidApplication1
> {
>    [Activity(Label = "MonoAndroidApplication1", MainLauncher = true, Icon =
> "@drawable/icon")]
>    public class Activity1 : Activity
>    {
>        int count = 1;
>
>        protected override void OnCreate(Bundle bundle)
>        {
>            base.OnCreate(bundle);
>
>            // Set our view from the "main" layout resource
>            SetContentView(Resource.Layout.Main);
>
>            // Get our button from the layout resource,
>            // and attach an event to it
>            Button button = FindViewById<Button>(Resource.Id.MyButton);
>
>            button.Click += delegate { button.Text = string.Format("{0}
> clicks!", count++); };
>        }
>    }
> }
>
> And when im running it i see the window of the emulator device. I selected
> start emulator image.
> There i created new emulator device for anroid 2.2
> When i select it the emulator is running.
>
> But:
>
> 1. I put a breakpoint in my code on the forst line  int count = 1;
> But when im running the program it dosent stop there. Like it dosent even
> go
> to my code.
> Its justl oading the window with the emulator devices and if i run the
> emulator i can see the anroid emulator but it never gets to the code i
> wrote
> and never get into the breakpoint !
> Like the code isnt connected with the emulator ? So strange.
>
> 2. Another problem even that i installed anroid sdk tools to C:\Android
> Still when im quiting the emulator devices window im getting in my code
> window an error:
> Deployment errors. Only if im doing in my code Deploy to my project im not
> getting this error when quiting the emulator devices window.
>
>
> So why my code isnt stop on the breakpoint like the code isnt running or
> not
> connected.
>
> When im doing F5 its first loading the emulator devices window like it
> dosent even go to the code it self.
>
> Cant figure out whats going on.
>
>
> Thanks for helping.
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/Tried-using-breakpoint-in-my-code-but-no-effect-why-looks-like-my-code-isnt-running-even-if-i-debug--tp4659188p4659188.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to