Note that there are some explanatory texts on larger screens.

plurals
  1. POCallback from adapter to activity in monodroid
    primarykey
    data
    text
    <p>So I have a listview and a gridview in my activity. Both have custom adapters. If a DragAction.Drop is performed I show a alert to confirm the action. If the user confirms this I will change some data in de database. Now the data is changed I need to refresh the listview. The method already exists but is part of the activity. I perform the alert and other actions that need to be done on drop in the adapter. So I need to tell the activity that the actions for the drop are completed. So the activity can call the refresh method.</p> <p>This is my code from the DragAction.Drop in the adapter:</p> <pre><code>case DragAction.Drop: truckNumber = e.Event.ClipData.GetItemAt (0).Text; truckLabelText = e.Event.ClipDescription.Label; AlertDialog.Builder alertBuilder = new AlertDialog.Builder (context); alertBuilder.SetTitle ("Please confirm"); alertBuilder.SetMessage ("Are you sure you want to assign Truck: " + truckNumber + " to Dock: " + dockName.Text + "?"); alertBuilder.SetPositiveButton ("Yes", async delegate { currentTruck.SetText (truckNumber, TextView.BufferType.Normal); truckLabel.SetText (truckLabelText, TextView.BufferType.Normal); await _DataLayer.changeTruckStatusCode (Convert.ToInt32 (truckNumber), 3); }); alertBuilder.SetNegativeButton ("No", delegate { }); alertBuilder.Show (); e.Handled = true; break; } }; dockName.SetText (item.name.ToString (), TextView.BufferType.Normal); currentTruck.SetText ("", TextView.BufferType.Normal); truckLabel.SetText ("", TextView.BufferType.Normal); return view; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload