@Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.menu_clear:
                Log.i(LOG_TAG, "Clear menu item selected");
                mListAdapter.clear();
                return true;

            case R.id.menu_refresh:
                Log.i(LOG_TAG, "Refresh menu item selected");

                // We make sure that the SwipeRefreshLayout is displaying it's refreshing indicator
                if (!mSwipeRefreshLayout.isRefreshing()) {
                    mSwipeRefreshLayout.setRefreshing(true);
                }

                // Start our refresh background task
                initiateRefresh();

                return true;
        }

        return super.onOptionsItemSelected(item);
    }
Respond to the user's selection of the Refresh action item. Start the SwipeRefreshLayout
progress bar, then initiate the background task that refreshes the content.
SwipeRefreshMultipleViews/Application/src/main/java/com/example/android/swiperefreshmultipleviews/SwipeRefreshMultipleViewsFragment.java