I need a way to get all checked items position in listview?I need this for deleting the notes. As of now i am doing like this
if (noteCheckBox != null) {
noteCheckBox.Click += (sender, e) => {
if(noteCheckBox.Checked)
{
listViewItem.SetBackgroundColor(Color.Yellow);
noteIds.Add(this._notes[position].NoteId.ToString());
}
else
{
listViewItem.SetBackgroundColor(Color.Transparent);
}
string[] noteIdArray = noteIds.ToArray();
var noteIdList = new Intent();
noteIdList.PutExtra("DeleteNotes", noteIdArray);
};
}
And to get id's:
if (this._deleteButton != null) {
this._deleteButton.Click += (sender, e) =>
{
var test = new Intent();
Array myList = (Array) test.GetSerializableExtra("DeleteNotes");
if(myList != null)
{
foreach(string s in myList)
{
Guid id = new Guid(s);
Delete(id);
}
}
};
}
But myList is null. How to fix it?