What are the launch-properties of your sub-activity? Is it a 'singleTask' or 'singleInstance'? If so, the sub-activity won't report a result to your main-activity's 'onActivityResult()'.
I ask this, because i was struggling with this same issue for a while until i discovered that my sub-activity was set to 'singleTask'.... On Apr 25, 11:27 pm, SChaser <[email protected]> wrote: > Help! > > I have an activity that, instead of getting a response back from a > startActivityForResult, is destroyed (with no callbacks) when the > responding activity finishes! > > The activity (call it GL) subclasses Activity and sets its contentView > to be a GLSurfaceView. This Activity overlays a MapView and uses > translucency to draw OpenGL objects over the Map. > > Here are the details: > The app that uses Intents for a menu system. > > An activity needing a menu does: > > ...startActivityForResult(intent, 0) > > to fire off the menu (a ListView). > > When the menu item is selected, the menu sets a result with: > > ........setResult(Activity.RESULT_OK, intent); menuActivity.finish(); > > In the originating activity, the onActivityResult should be called > with the results. > > I have two activities - one where that works, one where it doesn't. > Both use the same common method to do the setActivityForResult call. > > The first a MapActivity which is also the starting activity of my app. > It has no problem using the menu system to get results. > > The second is the GL Activity, an Activity which sets it content to be > a GLSurfaceView. > > This activity never sees onActivityResult after it sends the menu > intent, and it also vanishes without a trace (no lifecycle methods > called other than suspend()). > > So the flow is like this: > > MapView ---- intent ---> MenuActivity > displays list of choices > receives a click on a choice > sets a response > calls finish() > mapview.onActivityResult <-- called with result > > mapview --- intent ---> Activity using GLSurfaceView > renders shape > gets a click > sends an intent ---intent----->MenuActivity > > onSuspend called > displays list of choices > > receives a click on a choice > > sets a response > > calls finish() > surfaceview activity vanishes <---- > unexplained magic -------- > > Something odd is going on here! > > Any ideas? > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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

