2

Is there a way to force-quit Google App (AKA Google Search) from my app?

If so, how to do that?

Introspective
  • 554
  • 2
  • 5
  • 13

2 Answers2

1

In general, you will need ActivityManager's killBackgroundProcesses():

  public static void killOtherPackage(Context ctx) {
        if (ctx != null) {      
        ActivityManager am = (ActivityManager) ctx.getSystemService(ctx.ACTIVITY_SERVICE);
        if (am != null)
            am.killBackgroundProcesses("com.comp.prodline.specificpack");
        }

  }

Plus android.permission.KILL_BACKGROUND_PROCESSES in the manifest.

But I doubt that you will succeed killing Google's app.

More on this can be found in this thread.

Community
  • 1
  • 1
sfinja
  • 400
  • 4
  • 11
0

Try this

   android.os.Process.killProcess(android.os.Process.myPid());
Diego Fortes
  • 207
  • 2
  • 9