tags:

views:

42

answers:

4

Hi all,

Is it possible to programmatically close all running applications of IPhone with my application ?

any suggestion will be great help !!!

Thanks... Best Regards

+1  A: 

No. All apps run in a sandbox so that you can't communicate between them. And even if you technically could it would be considered bad practice.

Why do you need to close other apps? I can't think of any valid use case where that would be necessary.

Stephen Darlington
maybe in order to have a powerful remote that can shut others' iphone on demand, isn't it obvious? : D
rano
Thanks Stephen for the answer.
Mudassir
But Is it possible to close all applications by clicking on home button. I mean programmatically, is it possible ?
Mudassir
You can exit your app when someone presses the home button. But you can't affect any other running app.
Stephen Darlington
A: 

It's not possible and there's also no need to.

There are very conservative limits on how much processing a background app can use and if the result of low memory warnings is that there still isn't enough memory, the OS will automatically start killing things. Don't try to be clever - it's just as willing to kill you and indeed will kill you first if nothing else is running.

Tommy
A: 

Thanks Stephen for the answer.

But Is it possible to close all applications by clicking on home button. I mean programmatically, I can capture HOME button CLICK event,and then close all applications ?

Mudassir
Why did you repost your comments as an answer?
BoltClock
Never post an answer to your own question **unless it really is the answer to your question**. I suggest you read the [FAQ](http://stackoverflow.com/faq).
Jonathan Sterling
Also, you misunderstand what the Home button does (mind you, not the “HOME” button, no need for overcapitalization). Clicking it (not “CLICKing” as you so loudly put it) does not quit any application, in fact. It puts the application into a standby mode, whence it’ll be resumed when they are next shown. The system will quit some applications as more memory is needed, but you have no control over this. Please stop trying to do something truly stupid and terrible, or if you really want to do crazy batshit like this, develop for Android.
Jonathan Sterling
A: 

An app doesn't have access to the home button on a stock device. The only other access to any other apps in the background is if they have registered a URL handler.

hotpaw2