分享活动和MapActivity之间的选项菜单 [英] Sharing an Options Menu between Activity and MapActivity

查看:171
本文介绍了分享活动和MapActivity之间的选项菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

分享活动和MapActivity之间的一个选项菜单。 这可能吗?

Sharing an Options Menu between Activity and MapActivity. Is this possible?

我有一个选项菜单多种活动之间共享,但现在我需要在一个MapActivity该菜单。

I have an Options Menu shared between multiple Activities but now I need that menu in a MapActivity.

推荐答案

定义XML中的菜单。把智慧来加载XML的静态方法,然后调用从 onCreateOptionsMenu这个方法()在各个类。放入另一个静态方法的智慧为 onOptionsItemSelected(),并呼吁从 onOptionsItemSelected这个方法()在各个类

Define the menu in XML. Put the smarts to load that XML in a static method, then call that method from onCreateOptionsMenu() in your various classes. Put the smarts for onOptionsItemSelected() in another static method, and call that method from onOptionsItemSelected() in your various classes.

这篇关于分享活动和MapActivity之间的选项菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆