Wait for a subactivity to complete

Put your problem here if it does not fit any of the other categories.

Wait for a subactivity to complete

Postby xyz_1000 » Thu Feb 28, 2008 8:47 pm

Hi,
For my program I have to start a bunch of sub activities dynamically.I do this in a for loop in the main activity class. The problem is all the activities get started immediately. I want the activity[i] to get started only after user has clicked next in activity[i-1] returns a result. How do i do that? I am aware of the list of activities I have to start only during run time.
xyz_1000
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Feb 28, 2008 8:39 pm

Top

Postby cabernet1976 » Fri Feb 29, 2008 2:30 am

Hi xyz_1000,

What about Activity.onActivityResult :?:
When you click next in activity[i-1], SubActivity use setResult to transmite information (e.g. a SubActivity name) to Activity, and in Activity.onActivityResult to get SubActivity name then start next SubActivity.
You can refer this tutorials: http://www.anddev.org/subactivites_with ... x-t99.html
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 16 guests