gpt4 book ai didi

android - onCreateOptionsMenu(Menu menu) 和 onPrepareOptionsMenu(Menu menu) 有什么区别?

转载 作者:IT王子 更新时间:2023-10-28 23:56:27 29 4
gpt4 key购买 nike

解释 onCreateOptionsMenu(Menu menu)onPrepareOptionsMenu(Menu menu) 的区别。

最佳答案

onCreateOptionsMenu() 被调用一次。
每次打开菜单时都会调用 onPrepareOptionsMenu()


来自 onCreateOptionsMenu()文档:

This is only called once, the first time the options menu is displayed. To update the menu every time it is displayed, see onPrepareOptionsMenu(Menu).

关于android - onCreateOptionsMenu(Menu menu) 和 onPrepareOptionsMenu(Menu menu) 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14043631/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com