在Android的活动将焦点 [英] Change focus of activities in android

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

问题描述

我使用android系统中一个对话框主题活动以显示从应用程序上下文弹出。该对话框中有一个透明的主题,但问题是,我想下面的活动有重点,而不是弹出尽管弹出必须visble。如何在Android的实现这一目标?

I am using a dialog themed activity in android to show a popup from a application context. The dialog has a transparent theme, but the issue is that I want the underlying activity to have focus and not the popup though the popup must be visble. How do I achieve this in android?

推荐答案

您不能活动之间切换焦点。只有一个活动的焦点的时间,是在这一点上所显示的之一。透明背景并不意味着你可以在下面访问活动。

You can not switch focus between activities. There's only one activity "on focus" at the time, and is the one that is being displayed at that point. The transparent background doesn't mean you can access the activity below.

如果我没有弄错了,你要能够同时具有屏幕上对话的活动的控件进行交互。任何来自Android的排序对话框类没有帮助,因为他们采取的焦点了。真的不知道有关PopupWindow,但我猜将是同样的事情文档说的,关于当前活动的顶部出现。

If i don't get it wrong, you want to be able to interact with the activity's controls while having a "Dialog" on the screen. Any sort of Dialog class from Android will not help, since they take the focus away. Not really sure about PopupWindow, but i'm guessing will be the same thing as the documentation says "that appears on top of the current activity."

您将不得不创建活动中使用的RelativeLayout /的FrameLayout自定义对话框。

You are going to have to create a custom dialog using a RelativeLayout/FrameLayout within your activity.

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

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