Espresso click menu item

后端 未结 7 1100
感动是毒
感动是毒 2020-12-14 16:11

I have a menu in the actionbar which I create through:

@Override
public boolean onCreateOptionsMenu(Menu menu) {

    menu.add(Menu.NONE, 98,Menu.NONE,R.stri         


        
相关标签:
7条回答
  • 2020-12-14 17:08

    The toolbar is not the actionBar, no need of the call :

    openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getTargetContext());
    

    And if you do it, that's sure your item won't be found there (it's not in the ActionBar) and the ToolBar belongs to the "normal view".

    0 讨论(0)
提交回复
热议问题