Skip to content

Instantly share code, notes, and snippets.

@jezinka
Last active Aug 11, 2018
Embed
What would you like to do?
refresh menu
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_refresh:
swipeRefreshLayout.setRefreshing(true);
sendQueryForData();
return true;
}
// User didn't trigger a refresh, let the superclass handle this action
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment