[android-developers] Re: dealing with multiple activities

2008-12-29 Thread Andrew Stadler
This suggestion is correct- use the intent "extras" to send your own data back-and-forth to the sub-launched activity. Here are a couple of things to consider: (1) If at all possible, the sub activity should not crash if expected extras data is not found in the launching intent. (Null pointer

[android-developers] Re: dealing with multiple activities

2008-12-28 Thread gstavrev
You are on the right track. I`m not an expert, but I was playing with the same thing yesterday. You use the addExtras function for the Intent, but you use a Bundle as an argument. In the bundle I believe you can store values as an associative aray or hash. You then extract the bundle and the assoc

[android-developers] Re: dealing with multiple activities

2008-12-27 Thread Sarath Kamisetty
Hi, Thanks for the tips. Is it possible to pass an arbitrary object to the child activity and back ? The examples I saw were setting stuff inside the intent itself. For example, from parent to child, I query a content provider that returns a bunch or rows displayed by list activity. Once user sel

[android-developers] Re: dealing with multiple activities

2008-12-27 Thread Emmanuel
Call the second activity with startActivityForResult, add a SetResult ( ... ) with your result just before calling finish in your second activity, then in your first activity, onActivityResult will be called, where you can treat your results. Hope it helps, Emmanuel http://androidblogger.blogspo

[android-developers] Re: dealing with multiple activities

2008-12-27 Thread Mark Murphy
Sarath Kamisetty wrote: > Is there any example out there where one activity creates another > activity and the new activity returns something to the old one ? In my > application, when user clicks on a button, I need to move to a new > activity where I display a list of items and once the user sel