Hallo and thanks for your time.
I recently decided to try using Xamarin.Android to develop an idea that I had.
However, I ran into the strangest problem I have ever encountered.
public class Note : INote { public string Content { get; set; } public DateTime DateTime { get; set; } public List<ITag> Tags { get; set; } public override string ToString() { try { const int maxLength = 20; if (Content.Length > maxLength) { return Content.Substring(0, maxLength - 1); } return Content; } catch (Exception) { return Content; } } }
In the above class, when I do a ToString operation for a note object with less than 20 characters, I get an unhandled exception. I thought it was rather strange, so I wrapped the part with a substring in try / catch.
However, I still get an unhandled exception. How can it be?

EDIT: The exception window also looks werid. Usually they look like this. 
ToString is called when the ListView is populated, which runs in this piece of code.
[Activity(Label = "@string/ApplicationName")] public class ShowNotesActivity : Activity { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ShowNotes); var persistence = new Persistence(); var listView = FindViewById<ListView>(Resource.Id.listView1); var adapter = new ArrayAdapter<INote>(this, Android.Resource.Layout.SimpleListItem1, persistence.GetAllNotes()); listView.Adapter = adapter; } }
source share