Questions tagged «oncreateoptionsmenu»

5
片段内的onCreateOptionsMenu
我已放置setHasOptionsMenu(true)在内部onCreateView,但仍无法调用onCreateOptionsMenu内部片段。 @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { setHasOptionsMenu(true); return inflater.inflate(R.layout.facesheet, container, false); } 下面是我的onCreateOptionsMenu代码。 @Override public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) { getSupportMenuInflater().inflate(R.menu.layout, menu); return (super.onCreateOptionsMenu(menu)); } 我收到的错误消息: 该方法onCreateOptionsMenu(Menu)类型片段的必须重写或实现的超类型方法。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.