Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,808,000 Members 49,149 Now Online
XDA Developers Android and Mobile Development Forum

[Q] How to kill a app programatically

Tip us?
 
bharath87
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 1
Join Date: Jan 2014
Default [Q] How to kill a app programatically

Hi,
I am trying to kill an application using " ActivityManager.killBackgrounProcess()" but the application is not killed.

Could anyone please help on how to kill an application programatically ?
 
vishal007
Old
#2  
vishal007's Avatar
Senior Member
Thanks Meter 201
Posts: 1,121
Join Date: Sep 2011
Location: Dehradun
Quote:
Originally Posted by bharath87 View Post
Hi,
I am trying to kill an application using " ActivityManager.killBackgrounProcess()" but the application is not killed.

Could anyone please help on how to kill an application programatically ?
Try finish();
 
SimplicityApks
Old
#3  
SimplicityApks's Avatar
Senior Member
Thanks Meter 327
Posts: 323
Join Date: May 2013
Location: Aachen
Quote:
Originally Posted by vishal007 View Post
Try finish();
That will only work if the app he is trying to kill is his own and is currently running .

If I get you right, you need to use
Code:
android.os.Process.killProcess(android.os.Process.myPid());
Read this similar question for further help.
The Following User Says Thank You to SimplicityApks For This Useful Post: [ Click to Expand ]
 
vishal007
Old
#4  
vishal007's Avatar
Senior Member
Thanks Meter 201
Posts: 1,121
Join Date: Sep 2011
Location: Dehradun
Quote:
Originally Posted by SimplicityApks View Post
That will only work if the app he is trying to kill is his own and is currently running .

If I get you right, you need to use
Code:
android.os.Process.killProcess(android.os.Process.myPid());
Read this similar question for further help.
I see
 
Gh30
Old
#5  
Gh30's Avatar
Junior Member
Thanks Meter 3
Posts: 28
Join Date: Mar 2012
Location: Timisoara
Try this:
finish();
System.exit(0);
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes