[mono-android] Redraw/refresh problem

Christian Weyer christian.weyer at thinktecture.com
Mon Dec 19 17:59:58 EST 2011


Hi all,

I have code like this (using Monodroid.Dialog from https://github.com/kevinmcmahon/MonoDroid.Dialog):

private void RegisterMessagesHandler()
{
    Task.Factory.StartNew(() =>
    {
        while (true)
        {
            try
            {
                var message = broker.ReceiveAndDeleteMessage(topicName + "/Subscriptions/" + subscriptionName);
                if (!String.IsNullOrWhiteSpace(message))
                {
                    RunOnUiThread(delegate
                    {
                        messages.Elements.Add(new StringElement(message));
                        da.NotifyDataSetChanged();
                    });
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
    });
}

Everything seems to work fine. But after three and more entries the list gets messed up (screenshot):

[cid:image001.png at 01CCBEAA.50276AA0]

Any idea?

Thanks,
-Christian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111219/77d7b5b2/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 31785 bytes
Desc: image001.png
Url : http://lists.ximian.com/pipermail/monodroid/attachments/20111219/77d7b5b2/attachment-0001.png 


More information about the Monodroid mailing list