见行动起来吧所有活动 - 机器人来吧、机器人、行动

2023-09-06 03:44:52 作者:扑到你怀里

在我的主要活动,我有我的行动吧。怎么能这样保持可见,即使我推出一个新的活动?

In my main activity I have my action bar. How can this stay visible even if I launch a new activity?

有没有新的活动已延长我的主要活动这个工作?

Does the new activity have to extend my main activity for this to work?

推荐答案

如果您声明 onCreateOptionMenu 方法,至极是一个你把元素在动作条,在您的主要活动(一),其他所有活动扩展,而无需重新声明该方法会产生相同的动作条。

If you declare the onCreateOptionMenu method, wich is the one where you put the elements in the actionbar, in you main activity (A), all the other activities that extend A without re-declaring that method will have the same actionbar of A.