0

How to terminate an application which is launched from my current application in android?

For eg:

Suppose I am starting YouTube from my own application then is there any way to terminate the YouTube application programatically from my app.

AMT
  • 136
  • 5

2 Answers2

0

You can simply use finish(); to finish that.

Kanwaljit Singh
  • 4,339
  • 2
  • 18
  • 21
  • I can use finish(), only to terminate the activity of my application; not the YouTube. – AMT Dec 27 '13 at 05:15
0

Not unless the device is rooted -- it doesn't matter if you sent the intent from your app to launch it, it's not your app but the OS that started the app, and you don't have any permissions to control other apps.

user496854
  • 6,461
  • 10
  • 47
  • 84
  • I have the root access. – AMT Dec 27 '13 at 05:17
  • Then it doesn't matter if you launched the intent from your app. You need to be able to just kill another process, and you can look here: http://stackoverflow.com/questions/7397668/how-to-kill-all-running-applications-in-android – user496854 Dec 27 '13 at 07:05