0

I searched a lot and didn't find how to programmatically bring application to background so phone's home screen is shown. I don't want to terminate app, but just to programmatically make press on HOME button. Is there any way to do it?

Cœur
  • 37,241
  • 25
  • 195
  • 267
milan.rancic
  • 219
  • 1
  • 8
  • What's the reason for wanting to do this? Since it isn't officially supported and directly against Apple's guidelines, maybe some one can give you an alternative solution to your overall goal instead of this specific request. – valdetero Mar 07 '13 at 16:36
  • possible duplicate of [Sending Application to background on iphone](http://stackoverflow.com/questions/3584999/sending-application-to-background-on-iphone) – Taryn Mar 08 '13 at 02:08

3 Answers3

1

Unfortunately, there is no background mode in iOS where the app can still run things while out of focus. Apple has designed the system to "pause" the application so state is preserved, but be careful the app can be terminated at any time.

MattB
  • 1,104
  • 8
  • 15
  • I don't need to execute anything while in background. I just want to remove it from screen, so thats not problem. Can you give me some reference or some snippets? – milan.rancic Mar 07 '13 at 15:52
1

No, unfortunately not. There is no public API that allows you to send a user back to the homescreen.

As shown in these questions:

Brad Larson provides a detailed explanation to the answer of this question:

Community
  • 1
  • 1
Elliott
  • 4,598
  • 1
  • 24
  • 39
0

You can do this by calling a private API but beware as said above Apple does not allow this on AppStore apps.

var x = UIApplication.SharedApplication;
x.PerformSelector (sel: new MonoTouch.ObjCRuntime.Selector ("suspend"), obj: x, delay: 5);
dalexsoto
  • 3,412
  • 1
  • 27
  • 43