Post Reply Subscribe to Thread Email Thread

[Q] How to kill a app programatically

24th January 2014, 04:00 PM |#1  
OP Junior Member
Thanks Meter: 0
 
1 posts
Join Date:Joined: Jan 2014
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 ?
 
 
24th January 2014, 05:02 PM |#2  
vishal007's Avatar
Senior Member
Flag Dehradun
Thanks Meter: 273
 
1,220 posts
Join Date:Joined: Sep 2011
More
Quote:
Originally Posted by bharath87

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();
24th January 2014, 05:47 PM |#3  
SimplicityApks's Avatar
Senior Member
Flag Aachen
Thanks Meter: 340
 
346 posts
Join Date:Joined: May 2013
More
Quote:
Originally Posted by vishal007

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: [ View ]
24th January 2014, 07:20 PM |#4  
vishal007's Avatar
Senior Member
Flag Dehradun
Thanks Meter: 273
 
1,220 posts
Join Date:Joined: Sep 2011
More
Quote:
Originally Posted by SimplicityApks

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
28th January 2014, 08:39 PM |#5  
Gh30's Avatar
Member
Flag Timisoara
Thanks Meter: 3
 
32 posts
Join Date:Joined: Mar 2012
More
Try this:
finish();
System.exit(0);
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes