android: menu item click event from fragment

独自空忆成欢 提交于 2019-12-05 21:41:58

If you want to capture the click on your item, implement

public boolean onOptionsItemSelected(MenuItem item)

And then:

If your activity includes fragments, the system first calls onOptionsItemSelected() for the activity then for each fragment (in the order each fragment was added) until one returns true or all fragments have been called.

You can follow the oficial reference:

http://developer.android.com/guide/topics/ui/menus.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!