0

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!

Community
  • 1
  • 1
Dayerman
  • 3,973
  • 6
  • 38
  • 54
  • Have a look at my [Answer](http://stackoverflow.com/questions/6677466/stuck-with-getting-camera-pic-when-using-the-tab-activity/6679665#6679665), It may help you – Adil Soomro Sep 14 '11 at 09:13

1 Answers1

0

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

Dharmendra
  • 33,296
  • 22
  • 86
  • 129
  • But that way is not Android programming, is it? I think should be some way using this example:http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html of passing the result from childAcitivty to the parent – Dayerman Sep 14 '11 at 09:07
  • I know that you can use startActivityForResult to start child activity and you can set result from child activity to parent activity by setResult() but in case of ActivityGroup the result is not passing to parent activity but instead activityGroup is receiving result – Dharmendra Sep 14 '11 at 10:16
  • Finally got the solution on the example i said, I can use the method finishFromChild in the class TabGroupActivity as the onActivityResult. – Dayerman Sep 14 '11 at 10:39
  • OK, I finally will implement that option. If I use TabActivityGroup I can TabA->A->B but B cant return value to A but to TabA, an then I have to reload A. – Dayerman Sep 14 '11 at 11:00
  • But from TabA how you will get value to A because A is already opened at that time – Dharmendra Sep 15 '11 at 03:41
  • Yes I can reload A from TabA passing the value. – Dayerman Sep 15 '11 at 08:26