补充 private void showPopupMenu(View view) {
        final PopupAdapter adapter = (PopupAdapter) getListAdapter();        // Retrieve the clicked item from view's tag
        final String item = (String) view.getTag();        // Create a PopupMenu, giving it the clicked view for an anchor
        PopupMenu popup = new PopupMenu(getActivity(), view);        // Inflate our menu resource into the PopupMenu's Menu
        popup.getMenuInflater().inflate(R.menu.popup, popup.getMenu());        // Set a listener so we are notified if a menu item is clicked
        popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem menuItem) {
                switch (menuItem.getItemId()) {
                    case R.id.menu_remove:
                        // Remove the item from the adapter
                        adapter.remove(item);
                        return true;
                }
                return false;
            }
        });        // Finally show the PopupMenu
        popup.show();
    }class PopupAdapter extends ArrayAdapter<String> {        PopupAdapter(ArrayList<String> items) {
            super(getActivity(), R.layout.list_item, android.R.id.text1, items);
        }        @Override
        public View getView(int position, View convertView, ViewGroup container) {
            // Let ArrayAdapter inflate the layout and set the text
            View view = super.getView(position, convertView, container);
            // Retrieve the popup button from the inflated view
            View popupButton = view.findViewById(R.id.button_popup);            // Set the item as the button's tag so it can be retrieved later
            popupButton.setTag(getItem(position));            // Set the fragment instance as the OnClickListener
            popupButton.setOnClickListener(PopupListFragment.this);
            // Finally return the view to be displayed
            return view;
        }
    }