@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.wei_xin_fragment, container, false); button = (Button) view.findViewById(R.id.press_button); registerForContextMenu(button); return view; }