I have an activity derived from ListActivity and a delegate click handler
defined for the List.  It appears the the click handler is being called
three times.  I have a Toast that displays the value of a global count
variable that increments each time it is displayed in the toast. Here's the
code:


        ListView.ItemClick += delegate(object sender, ItemEventArgs args)
        {
            Toast.MakeText(Application, ((TextView)args.View).Text + " " +
(count++).ToString(), ToastLength.Short).Show();
          }
        };


I currently have a workaround by using a flag that is set when it is called
the first time.  However, I consider this to be a dangerous workaround since
it is difficult to completely guarantees that my processing will finish
correctly and reset the flag so the click handler can be used again.

Is this a known bug, or has anyone else encountered this situation?  Is
there a a better way of setting the ItemClick handler or a better
workaround?

Thanks!

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/ListView-ItemClick-Bug-tp4659588p4659588.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

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

Reply via email to