从 TabActivity 内的活动返回结果
我有一个包含两个活动的 TabActivity。一个 ListView 用于收件箱,另一个用于发件箱。 当我单击 ListActivityThreads 上的某个项目(线程)时,我会在另一个 ListActivityThreadDetail 中获取该线程的消息。当我进行该活动并回复消息时,我想修改该单个线程并将其传递回 ListActivityThreads。
按照正常方式将结果设置回之前的活动,我这样做: 我在 ListActivityThreads 中使用 startActivityForResult
,并在 ListActivityThreadDetail 中设置意图的结果。但我无法在 ListActivityThreads 中获取有关 onActivityResult 的任何数据。
我尝试过不同的方法 启动活动并在 TabActivity 上传递值。但到目前为止还没有运气... 我无法使用 BroadcastReceiver,因为我的类已经扩展了 ListActivity。 另外,我一直在尝试使用 TabgroupActivity 和 示例启动ChildActivity。但无法使用 onActivityResult 方法接收任何内容,也无法在我的父活动上实现 finishFromChildActivity 。
我真的很困惑,任何帮助将非常感激!
I have a TabActivity with two Activities. One ListView for the inbox and another for the outbox.
When I click on an item(a thread) on the ListActivityThreads, I get the messages of that thread, in another ListActivityThreadDetail. When I am on that activity and answer a message I want to modify that single thread and passing it back to the ListActivityThreads.
Following the normal way to set results back to the previous activity I do this:
I use startActivityForResult
in ListActivityThreads and in ListActivityThreadDetail I set a result for the intent. But I cant get any data on onActivityResult in ListActivityThreads.
I have tried different ways to start activities and passing values on a TabActivity. But no luck so far...
I cant use a BroadcastReceiver as my class already extends ListActivity.
Also I have been trying this example using TabgroupActivity and startChildActivity. But cant receive anything using the method onActivityResult, neither implementing finishFromChildActivity on my parent acitivty.
I am really stuck with this, any help would be really appreciate!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决此问题的另一种方法是,您可以在父活动中采用一个
static
变量,并且您可以在子活动中访问该静态变量,并且在子活动中您可以修改该变量,因此您将被修改家长活动的价值There is one alternative for this problem is that you can take one
static
variable in parent activity and you can access that static variable in child activity and in child activity you can modify that variable and so you will get modified value in parent activity