If you mean "when the app is idle and in the foreground," the way that I would 
probably do it is by having an "idleStuff" thread that you pause in all of your 
Activity.Pause() overrides, and that resumes at the ends of your 
Activity.OnResume() overrides. If you also want it to do things while your app 
is not actively being interacted with by the user, you might want to write a 
Service. In any case, your idle tasks _must_ happen on a non-UI thread, 
otherwise the user will be completely unable to use your app.

Of course, it also depends on what you're trying to do. I seem to remember that 
there was a bug at one point where objects that were unmanaged by Dalvik (such 
as ones used in Mono's .NET threads!) were liable to be GC'd. I'm not sure if 
this is still the case. For every project that I've used m4a on so far, I 
haven't been able to get threading to work at all, and have needed to run 
everything on the UI thread. However, that issue sounds like it may have been 
fixed with the latest releases of Mono-Android, so your mileage may vary.

-----Original Message-----
From: monodroid-boun...@lists.ximian.com 
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of andineupert
Sent: Monday, October 17, 2011 11:53 AM
To: monodroid@lists.ximian.com
Subject: [mono-android] Idle Handler?

Does anybody know how to implement an idle handler? I want to execute some 
stuff when the app is idle.

Thank you.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to