点击Menu按钮时,如果实现Activity的OnCreateOptionsMenu函数,则可以设置Menu。
Initialize the contents of the Activity's standard optionsmenu.
This hook is called whenever an item in your options menu isselected.
如实现Activity的OnOptionsItemSelected(MenuItemitem)函数,则可以定制菜单项动作。
onCreateOptionsMenu(Menu menu)
Initialize the contents of the Activity's standard optionsmenu.
onOptionsItemSelected(MenuItem item)
This hook is called whenever an item in your options menu isselected.
Task是一系列Activity的栈,栈只有压栈和出栈两个动作,栈里的Activity不能重新排序。
Activity.finish()会销毁Activity,会执行onDestroy()。