0

I'm firing an intent to start some 3rd party apps (such as AngryBirds), but I'm having issues closing it:

            Intent IAB = new Intent();
            IAB.setAction(Intent.ACTION_VIEW);
            IAB.setClassName("com.rovio.angrybirds", "com.rovio.ka3d.App");
            startActivity (IAB);

the above works fine & launches the app. But when I try to call finish(), it does nothing, the app continues to play. Is there a way to close it?

thanks

droid_dev
  • 303
  • 4
  • 15

1 Answers1

0

Please Refer Kill Process.

You can try android.os.Process.killProcess(android.os.Process.myPid()); to kill application process.

Sorry! You can't Kill 3rd party applications. In recently some one is asked this questions. Please refer Kill another application.

Community
  • 1
  • 1
Jumpo
  • 641
  • 2
  • 6
  • 7
  • Refer this link also http://stackoverflow.com/questions/2092951/how-to-close-android-application possible to close your application. – Jumpo Aug 14 '12 at 00:48
  • Thanks Jumpo for your response. I tried calling sendSignal & killProcess but both of them have no effect: E/AppHandler( 2945): handleMessage:ProcessName = com.rovio.angrybirds, PID = 3023 E/AppHandler( 2945): handleMessage: Found AngryBirds, sending QUIT signal I/Process ( 2945): Sending signal. PID: 3023 SIG: 9 – droid_dev Aug 14 '12 at 02:16
  • Just for kicks, I also tried doing the same for com.android.phone, but that also failed to close – droid_dev Aug 14 '12 at 02:59
  • I guess the reason for the above not working is this (part of the documentation): Kill the process with the given PID. Note that, though this API allows us to request to kill any process based on its PID, the kernel will still impose standard restrictions on which PIDs you are actually able to kill. Typically this means only the process running the caller's packages/application and any additional processes created by that app; packages sharing a common UID will also be able to kill each other's processes. – droid_dev Aug 14 '12 at 18:03
  • Right, I figured that out. I actually tried pushing the app to the background (similar to clicking on the home button) but that also doesn't seem to work – droid_dev Aug 22 '12 at 19:45
  • Sorry, I don't understand. Please explain in detail. – Jumpo Aug 27 '12 at 11:05