Home>

I am doing a process to delete that item when I click on ExpandableListView, but I don't know how to update it on the spot.
When using ListView

// Delete and update from adapter
                    adapter.Remove ();
                    adapter.NotifyDataSetChanged ();
                    memolist.Adapter = adapter;


It was updated with. Please tell me how to update.
Where do you know the syntax of Xamarin?
I'm looking at the Android Developers and Xamarin Developers pages, but I'm not sure how to view them.><

Code ↓

memolist.ItemLongClick + = async (sender, e) =&gt;
            {
                var parent = (ExpandableListView) e.Parent;
                var packedPosition = parent.GetExpandableListPosition (e.Position);
                var groupPosition = ExpandableListView.GetPackedPositionGroup (packedPosition);
                var childPosition = ExpandableListView.GetPackedPositionChild (packedPosition);
                var type2 = ExpandableListView.GetPackedPositionType (packedPosition);
                if (type2 == PackedPositionType.Child)
                {
                    var item = (IDictionary&lt;string, object&gt;) parent.ExpandableListAdapter.GetChild (groupPosition, childPosition);
                    var deletefile = item ["CHILD_TITLE"]. ToString ();

                    // Delete and update from adapter
                    adapter.Remove ();
                    adapter.NotifyDataSetChanged ();
                    memolist.Adapter = adapter;
                    IFolder rootFolder = FileSystem.Current.LocalStorage;
                    IFile file = await rootFolder.GetFileAsync (deletefile + ".txt");
                    await file.DeleteAsync ();
  • Answer # 1

    I think I should delete the item directly from thechildListgiven in the constructor of SimpleExpandableListAdapter.

    childList [groupPosition] .Remove (item);
    adapter.NotifyDataSetChanged ();
      

    Where do you know the syntax of Xamarin?

    There is little information on Xamarin, so I'm looking for it mostly in Java.
    What I didn't understand is actually tried and solved.