I have an Activity that starts a second activity using
StartActivityForResult().

The second activity starts fine, and then spawns a thread to do some work. 
When the work is complete I want to return to the calling Activity by
calling SetResult() and Finish().

The problem is control doesn't return to the calling activity, the
application screen goes away (back to the launcher screen) and the debugger
never returns as if the app is hung.  

I figured that I needed to do it from the UI Thread so I tried using
RunOnUIThread() to perform the SetResult/Finish.  Still no luck.

So I created a Handler and used SendMessage to perform the action.  Still no
luck.

as a test, I then spun after starting the thread, checking the IsAlive flag
until the thread completed and then called SetResult/Finish.  Well that
worked!  However, this is not really useful.

Can somebody shed some light on what is happening here?

-Mike

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Help-with-Activity-Finish-tp5109329p5109329.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to