Custom Action View can't be clicked

后端 未结 3 1031
广开言路
广开言路 2020-12-25 13:49

I am trying to add a custom ActionView to my ActionBar.

I am trying to add the common refresh button. (ImageButton, Prog

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-25 14:17

    onOptionsItemSelected() should only be called if the action item is in the overflow menu which you should also handle. (you have it forced to "always" on action bar, so onOptionsItemSelected() won't get called).

    At onCreateOptionsMenu() after inflating, you must setup a OnMenuItemClickListener for the menu item.

提交回复
热议问题