August 2015
Intermediate to advanced
296 pages
6h 40m
English
The OnOptionsItemSelected() method is called whenever an action in the ActionBar is clicked and an instance of IMenuItem is passed in. The IMenuItem ItemId instance corresponds to the ID specified in the item definition and can be used to determine which action was clicked on. The following code shows the implementation of OnOptionsItemSelected() from the code bundle:
public override bool OnOptionsItemSelected (IMenuItem item)
{
switch (item.ItemId)
{
case Resource.Id.actionNew:
// place holder for creating new poi
return true;
case Resource.Id.actionRefresh:
DownloadPoisListAsync(url);
return true;
default :
return base.OnOptionsItemSelected(item);
}
}Note that we have simply created a placeholder ...
Read now
Unlock full access