Quantcast
Channel: onCreateOptionsMenu is never called - Stack Overflow
Viewing all articles
Browse latest Browse all 13

Answer by Deepanker Chaudhary for onCreateOptionsMenu is never called

$
0
0

Try This It works for me:---

@Overridepublic boolean onCreateOptionsMenu(Menu menu){    super.onCreateOptionsMenu(menu);    getMenuInflater().inflate(R.menu.home_page_menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case R.id.menu_delete:        Toast.makeText(this, "You pressed the Delete!",                 Toast.LENGTH_LONG).show();        break;      case R.id.menu_setting:     Intent intent=new Intent(HomePage.this,Setting.class);     startActivity(intent);     finish();     Toast.makeText(this, "You pressed the Setting!",     Toast.LENGTH_LONG).show(); break;    }    return super.onOptionsItemSelected(item);}

Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>