安卓活动导航 [英] Android activity navigation

查看:73
本文介绍了安卓活动导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,其中有主要活动,它显示一些内容(文本、图像等),并在其顶部显示一个半透明菜单.在此菜单中,我获得了指向其他屏幕"(作为活动实现)的链接,单击它后,我可以正确访问新活动,但设备的活动更改动画"闪烁,然后让我进入新活动.

I'm developing an app, where there is the main activity, it display some content (texts, images, etc), and a translucent menu on top of it. In this menu, I got link to other "screens" (implemented as Activities), on clicking it, I get correctly to the new activity, but the "activity changing animation" of the device blinks and then get me to the new activity.

我想让导航体验在浏览屏幕时无缝衔接,让我的菜单始终位于其顶部.今天,这个菜单被实现为一个自定义视图(扩展一个线性布局),这个菜单也可以展开和折叠,所以我必须通过活动来存储菜单状态.

I would like to make the navigation experience to be seamless on navigate through the screens, keeping my menu always on top of it. Today, this menu is implemented as a custom view (extending a Linear layout), also this menu will be expandable and collapsible, so the way it is I have to store the menu state through the activities.

PS:我认为始终保持两个正在运行的活动,一个用于当前屏幕,另一个用于菜单,将菜单保持在顶部,然后将活动更改为后面它.但找不到办法做到这一点...

PS: The way I've thought was to keep always two running activities, one for the current screen and another one for the menu, keep the menu on top, and just change the activity behind it. But could not find a way to do this...

PPS:为 Android 2.1 开发

PPS: Developing for Android 2.1

有人有想法吗?

推荐答案

你应该看看 片段,或尝试将所有功能保留在一个活动中,仅更改内容视图.

You should take a look at Fragments, or try to keep all functionality in one activity, changing only the content view.

这篇关于安卓活动导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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