override fun onCreateOptionsMenu(menu: Menu): Boolean { // Inflate the menu; this adds items to the action bar if it is present.
menuInflater.inflate(R.menu.menu_main, menu) return true} override fun onOptionsItemSelected(item: MenuItem): Boolean { // Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
val ty=item.itemId if (ty == R.id.action_settings){ val i= Intent(this,Main2Activity::class.java) startActivity(i) } if (ty == R.id.action_setting){ val i= Intent(this,About::class.java) startActivity(i) } if (ty == R.id.action_exit){ finish() } return super.onOptionsItemSelected(item) }
No comments:
Post a Comment