I have recently migrated from Eclipse to Android Studio and in doing so I have picked up the below error
java.lang.UnsupportedOperationException: This is not
The fix thanks to ρяσѕρєя K's comment. Much appreciated mate, thank you!!
MenuItemCompat.setOnActionExpandListener(searchItem,
new MenuItemCompat.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem menuItem) {
// Return true to allow the action view to expand
townList.setVisibility(View.VISIBLE);
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem menuItem) {
// When the action view is collapsed, reset the query
townList.setVisibility(View.INVISIBLE);
// Return true to allow the action view to collapse
return true;
}
});