Android: onCreateOptionsMenu() item action

后端 未结 4 2130
南旧
南旧 2021-02-06 23:49

I have a menu created through:

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    menu.add(\"Email\");

    return super.onCreateOptionsMenu(menu)         


        
4条回答
  •  再見小時候
    2021-02-07 00:37

        public boolean onOptionsItemSelected(MenuItem item) {
            switch(item.getItemId()) {
            case R.id.itemid:
                //do cool stuff
                break;
              }
         }
    

提交回复
热议问题