Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] How to kill a app programatically

OP bharath87

24th January 2014, 05: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, 06:02 PM   |  #2  
vishal007's Avatar
Senior Member
Flag Dehradun
Thanks Meter: 243
 
1,179 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, 06:47 PM   |  #3  
SimplicityApks's Avatar
Senior Member
Flag Aachen
Thanks Meter: 337
 
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, 08:20 PM   |  #4  
vishal007's Avatar
Senior Member
Flag Dehradun
Thanks Meter: 243
 
1,179 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, 09:39 PM   |  #5  
Gh30's Avatar
Member
Flag Timisoara
Thanks Meter: 3
 
31 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