As far as i know, you can't do this. Maybe you want to implement a modal dialog. Launch a (subclass of) android.app.Dialog instead. However, even when using dialogs by calling yourDialog.show(), the show () call returns immediately. It doesn't wait.
It looks like you have to re-write some of your code to handle the onActivityResults instead of the returned value of myFunction. On May 20, 5:30 am, "[email protected]" <[email protected]> wrote: > Hi, > > I have a problem with return value of a method witch launches an > Activty. > I would like a method witch launches an Activty and witch wait for > this Activity being complete before returning a value. > I note that , doing nothing special, the calling method achieves its > own code before launches the Activity. > How can i do to have a method witch waits for the activity finishes? > > My code is the following : > > -------------------------------------------------------- Begin Code > ------------------------------------------------------------ > String result; //class field > > public String myFunction (RootActivity rootAct, > final String title, > final ArrayList<String> label, > ArrayList<Integer> max) > { > root = rootAct; // The activity witch launches another activity > > action = SecondActivity.class; > > Intent i = new Intent(root, action ); > > root.startActivityForResult(i, 0); > > //The root activity initializes 'result' with result of > SecondActivity in onActivityResult method > // return s; > } > > -----------------------------------------------------------End > Code--------------------------------------------------------------------- > > Some help please :-) > > Cecilia --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

