更新的观点在一个活动从另一个 [英] Update views in one Activity from another

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

问题描述

我试图模仿使用与Theme.Dialog一个活动的软键盘。键盘活动涵盖了屏幕的一部分。底层活动仍处于活动状态,并且可以直接控制的。我想,因为它是输入的输入的文本显示在下面的活动。

I am trying to emulate a software keyboard using an Activity with Theme.Dialog. The keyboard activity covers only part of the screen. The underlying activity is still active and can be controlled directly. I would like the entered text to be displayed in the underlying Activity as it is typed.

有没有一种方法可以让我做到这一点?我在想扔我的EditText的引用而成为意向捆绑的,但是这似乎并不正确。

Is there a way I can do this? I was thinking of throwing a reference of my EditText into the Intent Bundle, but that does not seem correct.

修改:有人接,使静态的EditText,但随后被删除的响应。难道他们重新添加它情况下,这证明是正确的反应?

edit: someone answered to make the EditText static, but then deleted the response. Could they add it back in case this turns out to be the correct response?

推荐答案

我回答我的问题,因为谁提供的原始答案的人删除了它,并没有重新发布它。

I'm answering my own question because the person who supplied the original answer deleted it, and has not reposted it.

我发现到目前为止,在其中指的EditText被操纵的软件键盘活动创建一个静态字段中的最佳解决方案。调用活动,然后启动意图之前更新该静态字段。

The best solution I've found so far it to create a static field in the software keyboard activity which refers to the EditText being manipulated. The calling Activity then updates this static field before launching the intent.

这无缝工作,我已经没有任何问题与调用活动越来越点火升空堆栈。

This works seamlessly, and I've had no problems with the calling Activity getting blasted off the stack.

这篇关于更新的观点在一个活动从另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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